Skip to content

Commit

Permalink
Merge pull request #34 from Uniandes-isis2603/Pruebas-itinerario-y-re…
Browse files Browse the repository at this point in the history
…comendacion

Pruebas Nathalia
  • Loading branch information
jimenezzz authored Jun 6, 2022
2 parents 7cedc5e + 55dade9 commit 83adb19
Show file tree
Hide file tree
Showing 9 changed files with 11,990 additions and 141 deletions.
11,910 changes: 11,829 additions & 81 deletions package-lock.json

Large diffs are not rendered by default.

87 changes: 52 additions & 35 deletions reports/ut_report.xml
Original file line number Diff line number Diff line change
@@ -1,56 +1,73 @@
<testExecutions version="1">
<file path="src/app/recomendacion/recomendacion-detalle/recomendacion-detalle.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="2"/>
<file path="src/app/proveedor/proveedor-list/proveedor-list.component.spec.ts">
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de longitud " duration="514"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de id " duration="38"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de longitud " duration="299"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de latitud " duration="219"/>
<testCase name="ProveedorDetalleComponent should create" duration="79"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de latitud " duration="207"/>
</file>
<file path="src/app/seguro/seguro-detalle/seguro-detalle.component.spec.ts">
<testCase name="SeguroDetalleComponent should create" duration="1"/>
</file>
<file path="src/app/proveedor/proveedor-list/proveedor-list.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="11"/>
</file>
<file path="src/app/itinerario/itinerario-detalle/itinerario-detalle.component.spec.ts">
<testCase name="ItinerarioDetalleComponent should have a titulo alojamiento" duration="217"/>
<testCase name="ItinerarioDetalleComponent should create" duration="11"/>
<testCase name="ItinerarioDetalleComponent should have a día" duration="13"/>
<testCase name="ItinerarioDetalleComponent should have a titulo alimentacion" duration="10"/>
<testCase name="ItinerarioDetalleComponent should have a alojamiento" duration="11"/>
<testCase name="ItinerarioDetalleComponent should have a alimentacion" duration="10"/>
</file>
<file path="src/app/app.component.spec.ts">
<testCase name="AppComponent should create the app" duration="48"/>
<testCase name="AppComponent should have as title 'museums-front'" duration="6"/>
<testCase name="AppComponent should render title" duration="9"/>
<testCase name="AppComponent should render title" duration="108"/>
<testCase name="AppComponent should create the app" duration="205"/>
<testCase name="AppComponent should have as title 'museums-front'" duration="53"/>
</file>
<file path="src/app/recomendacion/recomendacion-detalle/recomendacion-detalle.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<file path="src/app/proveedor/proveedor-list/proveedor-list.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent should create" duration="698"/>
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de longitud " duration="23"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de id " duration="9"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de latitud " duration="8"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de longitud " duration="9"/>
<testCase name="ProveedorDetalleComponent should create" duration="7"/>
<testCase name="ProveedorDetalleComponent Deberia contener un atributo de latitud " duration="8"/>
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
</file>
<file path="src/app/seguro/seguro-detalle/seguro-detalle.component.spec.ts">
<testCase name="SeguroDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent should create" duration="5"/>
</file>
<file path="src/app/recomendacion/recomendacion-detalle/recomendacion-detalle.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent should create" duration="2"/>
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent should create" duration="97"/>
<testCase name="RecomendacionDetalleComponent should have a titulo indumentaria" duration="57"/>
<testCase name="RecomendacionDetalleComponent should have a titulo equipo" duration="16"/>
<testCase name="RecomendacionDetalleComponent should have a equipo" duration="7"/>
<testCase name="RecomendacionDetalleComponent should create" duration="47"/>
<testCase name="RecomendacionDetalleComponent should have a indumentaria" duration="20"/>
</file>
<file path="src/app/proveedor/proveedor-list/proveedor-list.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
</file>
<file path="src/app/seguro/seguro-list/seguro-list.component.spec.ts">
<testCase name="SeguroListComponent should create" duration="1"/>
</file>
<file path="src/app/recomendacion/recomendacion-detalle/recomendacion-detalle.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="2"/>
<file path="src/app/proveedor/proveedor-list/proveedor-list.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
<testCase name="ProveedorDetalleComponent should create" duration="1"/>
</file>
<file path="src/app/expedicion/expedicion-detalle/expedicion-detalle.component.spec.ts">
<testCase name="ExpedicionDetalleComponent should have a hora de llegada" duration="25"/>
<testCase name="ExpedicionDetalleComponent should have a nombre" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a dificultad" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a costo" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a lugar salida" duration="9"/>
<testCase name="ExpedicionDetalleComponent should have a description element" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a fecha de inicio" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a fecha final" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a hora de salida" duration="7"/>
<testCase name="ExpedicionDetalleComponent should create" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a duracion" duration="7"/>
<testCase name="ExpedicionDetalleComponent should have a lugar llegada" duration="6"/>
<testCase name="ExpedicionDetalleComponent should have a fecha de inicio" duration="195"/>
<testCase name="ExpedicionDetalleComponent should have a lugar salida" duration="137"/>
<testCase name="ExpedicionDetalleComponent should have a nombre" duration="72"/>
<testCase name="ExpedicionDetalleComponent should have a fecha final" duration="127"/>
<testCase name="ExpedicionDetalleComponent should have a lugar llegada" duration="23"/>
<testCase name="ExpedicionDetalleComponent should have a hora de salida" duration="31"/>
<testCase name="ExpedicionDetalleComponent should have a hora de llegada" duration="156"/>
<testCase name="ExpedicionDetalleComponent should have a dificultad" duration="144"/>
<testCase name="ExpedicionDetalleComponent should create" duration="26"/>
<testCase name="ExpedicionDetalleComponent should have a description element" duration="19"/>
<testCase name="ExpedicionDetalleComponent should have a costo" duration="23"/>
<testCase name="ExpedicionDetalleComponent should have a duracion" duration="150"/>
</file>
<file path="src/app/proveedor/proveedor-list/proveedor-list.component.spec.ts">
<testCase name="ProveedorDetalleComponent should create" duration="2"/>
<testCase name="ProveedorDetalleComponent should create" duration="2"/>
<testCase name="ProveedorDetalleComponent should create" duration="4"/>
</file>
</testExecutions>
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('ExpedicionDetalleComponent', () => {
id: faker.datatype.number(),
indumentaria: faker.lorem.sentence(),
equipo: faker.lorem.sentence(),
expedicion: {} as Expedicion
}
] as Recomendacion[],
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container">
<div class="text-center">
<img style = "margin-top: 2rem;" src="../../assets/images/itinerario.png">
<h2 style = "color: #37B08A; font-size: 4rem; margin-top: 2rem;">
<h2 id = "dia" style = "color: #37B08A; font-size: 4rem; margin-top: 2rem;">
Itinerario del día {{itinerario.dia}}
</h2>
</div>
Expand All @@ -10,20 +10,20 @@ <h2 style = "color: #37B08A; font-size: 4rem; margin-top: 2rem;">
<div style = "background-color: rgb(236, 236, 236); border-radius: 2rem;">
<div class="text-center">
<img style = "width: 8rem; padding-top: 1rem; padding-bottom: 1rem; "src="../../assets/images/comida.png">
<h3>
<h3 id = "titulo-alimentacion">
Alimentación
</h3>
<p style = "padding-bottom: 1rem;">{{itinerario.alimentacion}}</p>
<p id = "alimentacion" style = "padding-bottom: 1rem;">{{itinerario.alimentacion}}</p>
</div>
</div>

<div style = "background-color: rgb(236, 236, 236); border-radius: 2rem; margin-bottom: 5rem;">
<div class="text-center">
<img style = "width: 8rem; padding-top: 1rem; padding-bottom: 1rem;"src="../../assets/images/cama.png">
<h3>
<h3 id = "titulo-alojamiento">
Alojamiento
</h3>
<p style = "padding-bottom: 1rem;">{{itinerario.alojamiento}}</p>
<p id = "alojamiento" style = "padding-bottom: 1rem;">{{itinerario.alojamiento}}</p>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,62 @@
import {TestBed } from '@angular/core/testing';
import {async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ItinerarioDetalleComponent } from './itinerario-detalle.component';
import { DebugElement } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { RouterTestingModule } from '@angular/router/testing';
import { faker } from '@faker-js/faker';

describe('ProveedorDetalleComponent', () => {
beforeEach(() => {
describe('ItinerarioDetalleComponent', () => {
let component: ItinerarioDetalleComponent;
let fixture: ComponentFixture<ItinerarioDetalleComponent>;
let debug: DebugElement;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule]
});
imports:[HttpClientModule, RouterTestingModule],
declarations: [ ItinerarioDetalleComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(ItinerarioDetalleComponent);
component = fixture.componentInstance;

component.itinerario = {
id : faker.datatype.number(),
dia: faker.lorem.sentence(),
alimentacion: faker.lorem.sentence(),
alojamiento: faker.lorem.sentence()
}

fixture.detectChanges();
debug = fixture.debugElement;
});

it('should create', () => {
expect(ItinerarioDetalleComponent).toBeTruthy();
expect(component).toBeTruthy();
});

it('should have a día', () => {
expect(debug.nativeElement.querySelector('#dia').textContent).toContain(component.itinerario.dia)
});

it('should have a alojamiento', () => {
expect(debug.nativeElement.querySelector('#alojamiento').textContent).toContain(component.itinerario.alojamiento)
});

it('should have a alimentacion', () => {
expect(debug.nativeElement.querySelector('#alimentacion').textContent).toContain(component.itinerario.alimentacion)
});

it('should have a titulo alojamiento', () => {
expect(debug.nativeElement.querySelector('#titulo-alojamiento').textContent).toContain("Alojamiento")
});

it('should have a titulo alimentacion', () => {
expect(debug.nativeElement.querySelector('#titulo-alimentacion').textContent).toContain("Alimentación")
});

});

2 changes: 1 addition & 1 deletion src/app/model/trekking.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export interface Recomendacion {
id: number;
indumentaria: string;
equipo: string;
expedicion: Expedicion;

}

export interface Mapa{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ describe('ProveedorDetalleComponent', () => {
{
id: faker.datatype.number(),
indumentaria: faker.lorem.sentence(),
equipo: faker.lorem.sentence(),
expedicion: {} as Expedicion
equipo: faker.lorem.sentence()
}
] as Recomendacion[],
}] as Expedicion[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ <h2 style = "color: #37B08A; font-size: 4rem; margin-top: 2rem;">
<div style = "background-color: rgb(236, 236, 236); border-radius: 2rem;">
<div class="text-center">
<img style = "width: 8rem; padding-top: 1rem; padding-bottom: 1rem; "src="../../assets/images/indumentaria.png">
<h3>
<h3 id = "titulo-indumentaria">
Indumentaria
</h3>
<p style = "padding-bottom: 1rem;">{{recomendacion.indumentaria}}</p>
<p id = "indumentaria" style = "padding-bottom: 1rem;">{{recomendacion.indumentaria}}</p>
</div>
</div>

<div style = "background-color: rgb(236, 236, 236); border-radius: 2rem; margin-bottom: 5rem;">
<div class="text-center">
<img style = "width: 8rem; padding-top: 1rem; padding-bottom: 1rem;" src="../../assets/images/equipo.png">
<h3>
<h3 id = "titulo-equipo">
Equipo
</h3>
<p style = "padding-bottom: 1rem;">{{recomendacion.equipo}}</p>
<p id = "equipo" style = "padding-bottom: 1rem;">{{recomendacion.equipo}}</p>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,16 +1,56 @@
import {TestBed } from '@angular/core/testing';
import {async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RecomendacionDetalleComponent } from './recomendacion-detalle.component';
import { DebugElement } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { RouterTestingModule } from '@angular/router/testing';
import { faker } from '@faker-js/faker';

describe('ProveedorDetalleComponent', () => {
beforeEach(() => {
describe('RecomendacionDetalleComponent', () => {
let component: RecomendacionDetalleComponent;
let fixture: ComponentFixture<RecomendacionDetalleComponent>;
let debug: DebugElement;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule]
});
imports:[HttpClientModule, RouterTestingModule],
declarations: [ RecomendacionDetalleComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(RecomendacionDetalleComponent);
component = fixture.componentInstance;

component.recomendacion = {
id: faker.datatype.number(),
indumentaria: faker.lorem.sentence(),
equipo: faker.lorem.sentence(),
}

fixture.detectChanges();
debug = fixture.debugElement;
});

it('should create', () => {
expect(RecomendacionDetalleComponent).toBeTruthy();
expect(component).toBeTruthy();
});

it('should have a indumentaria', () => {
expect(debug.nativeElement.querySelector('#indumentaria').textContent).toContain(component.recomendacion.indumentaria)
});

it('should have a equipo', () => {
expect(debug.nativeElement.querySelector('#equipo').textContent).toContain(component.recomendacion.equipo)
});

it('should have a titulo indumentaria', () => {
expect(debug.nativeElement.querySelector('#titulo-indumentaria').textContent).toContain("Indumentaria")
});

it('should have a titulo equipo', () => {
expect(debug.nativeElement.querySelector('#titulo-equipo').textContent).toContain("Equipo")
});

});

0 comments on commit 83adb19

Please sign in to comment.