diff --git a/src/app/map/services/map.service.spec.ts b/src/app/map/services/map.service.spec.ts index de3b0e0faebbcb5dfd143909227a334c629a1fde..eb3b55054360a7cfcab7375d35bb9e02d4e9a277 100644 --- a/src/app/map/services/map.service.spec.ts +++ b/src/app/map/services/map.service.spec.ts @@ -42,6 +42,6 @@ describe('MapService', () => { expect(service.getMarker(2)).toEqual(null); }); it('should not get marker, empty', () => { - expect(service.getMarker(1)).toEqual(null); + expect(service.getMarker(2)).toEqual(null); }); }); diff --git a/src/app/shared/components/logo-card/logo-card.component.html b/src/app/shared/components/logo-card/logo-card.component.html index dd679586ba9339286a7d0686ea671c88ccebf17e..3cc35f78f332a4ec3b744ff6f7ccb9ba60df9c89 100644 --- a/src/app/shared/components/logo-card/logo-card.component.html +++ b/src/app/shared/components/logo-card/logo-card.component.html @@ -1,4 +1,4 @@ -<div fxLayout="column" fxLayoutAlign="center center"> +<div fxLayout="column" fxLayoutAlign="center center" *ngIf="name"> <img [src]="'assets/logos/' + getLogoKey(name) + '.svg'" [alt]="'logo ' + name" /> <p>{{ name }}</p> </div> diff --git a/src/app/shared/components/logo-card/logo-card.component.spec.ts b/src/app/shared/components/logo-card/logo-card.component.spec.ts index f8bfe243cdf12fbe9e859b45651126ab3ba737c4..32b67d9f0b8743494662bef0f94db4be72968eb7 100644 --- a/src/app/shared/components/logo-card/logo-card.component.spec.ts +++ b/src/app/shared/components/logo-card/logo-card.component.spec.ts @@ -1,4 +1,5 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { Demarches } from '../../enum/demarches.enum'; import { LogoCardComponent } from './logo-card.component'; @@ -8,9 +9,8 @@ describe('LogoCardComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LogoCardComponent ] - }) - .compileComponents(); + declarations: [LogoCardComponent], + }).compileComponents(); }); beforeEach(() => { @@ -22,4 +22,15 @@ describe('LogoCardComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should return logo name with a string input', () => { + const logoCaf = component.getLogoKey(Demarches.caf); + const logoCarsat = component.getLogoKey(Demarches.carsat); + const logoCpam = component.getLogoKey(Demarches.cpam); + const logoOther = component.getLogoKey(Demarches.other); + expect(logoCaf).toEqual('caf'); + expect(logoCarsat).toEqual('carsat'); + expect(logoCpam).toEqual('cpam'); + expect(logoOther).toEqual('other'); + }); }); diff --git a/src/app/structure-list/components/card/card.component.spec.ts b/src/app/structure-list/components/card/card.component.spec.ts index cf8f87ef3a62bcc106e6bf53255baf104b7bef92..f3a5672df70b951fd57c4d9737575c09b0d54834 100644 --- a/src/app/structure-list/components/card/card.component.spec.ts +++ b/src/app/structure-list/components/card/card.component.spec.ts @@ -8,7 +8,7 @@ import { OpeningDay } from '../../../models/openingDay.model'; describe('CardComponent', () => { let component: CardComponent; let fixture: ComponentFixture<CardComponent>; - + let structure: Structure; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [HttpClientModule], @@ -19,7 +19,7 @@ describe('CardComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(CardComponent); component = fixture.debugElement.componentInstance; - const structure = new Structure({ + structure = new Structure({ id: 1, numero: '26-63', dateDeCreation: '2020-10-08T15:17:00.000Z', @@ -169,4 +169,28 @@ describe('CardComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should transform a distance into km', () => { + component.structure.distance = 4320; + const distance = component.formatDistance(); + expect(distance).toEqual('4.3 km'); + }); + it('should transform a distance into m', () => { + component.structure.distance = 400; + const distance = component.formatDistance(); + expect(distance).toEqual('400 m'); + }); + + it('should emit structure to show details', () => { + spyOn(component.showDetails, 'emit'); + component.cardClicked(); + expect(component.showDetails.emit).toHaveBeenCalled(); + expect(component.showDetails.emit).toHaveBeenCalledWith(structure); + }); + it('should emit structure on cardHover', () => { + spyOn(component.hover, 'emit'); + component.cardHover(); + expect(component.hover.emit).toHaveBeenCalled(); + expect(component.hover.emit).toHaveBeenCalledWith(structure); + }); }); diff --git a/src/app/structure-list/components/card/card.component.ts b/src/app/structure-list/components/card/card.component.ts index 4050fe75977be0d50656f01a435fc478ffb41f4a..faa643618883bbab38d6cf1dc735ea270d3e5401 100644 --- a/src/app/structure-list/components/card/card.component.ts +++ b/src/app/structure-list/components/card/card.component.ts @@ -38,6 +38,7 @@ export class CardComponent implements OnInit { } public cardClicked(): void { + console.log(this.structure); this.showDetails.emit(this.structure); } diff --git a/src/app/structure-list/components/modal-filter/modal-filter.component.spec.ts b/src/app/structure-list/components/modal-filter/modal-filter.component.spec.ts index 113f340a66937999f9b30393dd9b3db8dd57f7e4..d81c0bea51f58226b6a965e1961d508d2e6c0f93 100644 --- a/src/app/structure-list/components/modal-filter/modal-filter.component.spec.ts +++ b/src/app/structure-list/components/modal-filter/modal-filter.component.spec.ts @@ -76,7 +76,7 @@ describe('ModalFilterComponent', () => { { id: '167', text: 'training', count: 0 }, ]; component.checkedModules = modules; - const category: Category = { name: 'morefilters', modules: [modules[0], modules[1], modules[2]] }; + const category: Category = new Category({ name: 'morefilters', modules: [modules[0], modules[1], modules[2]] }); component.categories = [category]; component.clearFilters(); expect(component.checkedModules.length).toEqual(3); diff --git a/src/app/structure-list/components/search/search.component.spec.ts b/src/app/structure-list/components/search/search.component.spec.ts index 3b89eff5b6a17a51bab02e5cf2c782abd83aca11..647c986a81195db21a32ba7708eb03e74c9d0296 100644 --- a/src/app/structure-list/components/search/search.component.spec.ts +++ b/src/app/structure-list/components/search/search.component.spec.ts @@ -33,7 +33,7 @@ describe('SearchComponent', () => { // applyFilter function it('should emit filters', () => { - const filter: Filter[] = [new Filter('nomDeVotreStructure', 'valInput', false)]; + const filter: Filter[] = [new Filter('nomDeVotreStructure', 'valInput')]; spyOn(component.searchEvent, 'emit'); component.applyFilter('valInput'); expect(component.searchEvent.emit).toHaveBeenCalled(); diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index 2b506089740afb23fca0f7cb963f7dd3f3323f30..c81d453cb131c529697b68296e2c593befc58328 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.html +++ b/src/app/structure-list/components/structure-details/structure-details.component.html @@ -1,4 +1,4 @@ -<div class="structrue-details-container"> +<div class="structrue-details-container" *ngIf="structure"> <!-- Header info --> <div fxLayout="row" class="structrue-details-block" fxLayoutAlign="baseline baseline" fxLayoutGap="20px"> <em class="ic-arrow-left clickable hide-on-print" (click)="close()"></em> diff --git a/src/app/structure-list/components/structure-details/structure-details.component.spec.ts b/src/app/structure-list/components/structure-details/structure-details.component.spec.ts index c3ac8e9ae13f76c6017a69157462faea738ba19e..0b7a461151dfc972c2245ea0dd5ee8f6a72c0fd8 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.spec.ts +++ b/src/app/structure-list/components/structure-details/structure-details.component.spec.ts @@ -1,5 +1,9 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; - +import { Structure } from '../../../models/structure.model'; +import { AccessModality } from '../../enum/access-modality.enum'; +import { Category } from '../../models/category.model'; +import { Module } from '../../models/module.model'; import { StructureDetailsComponent } from './structure-details.component'; describe('StructureDetailsComponent', () => { @@ -8,18 +12,63 @@ describe('StructureDetailsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ StructureDetailsComponent ] - }) - .compileComponents(); + declarations: [StructureDetailsComponent], + imports: [HttpClientTestingModule], + }).compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(StructureDetailsComponent); component = fixture.componentInstance; fixture.detectChanges(); + let structure: Structure = new Structure(); + structure.lesCompetencesDeBase = ['123', '234', '817']; + component.structure = structure; }); it('should create', () => { expect(component).toBeTruthy(); }); + + it('should emit close action', () => { + spyOn(component.closeDetails, 'emit'); + component.close(); + expect(component.closeDetails.emit).toHaveBeenCalled(); + expect(component.closeDetails.emit).toHaveBeenCalledWith(true); + }); + + it('should return icon name with a string input', () => { + const iconNameGroup = component.getAccessIcon(AccessModality.free); + const iconNameCalendar = component.getAccessIcon(AccessModality.meeting); + const iconNameTel = component.getAccessIcon(AccessModality.numeric); + expect(iconNameGroup).toEqual('group'); + expect(iconNameCalendar).toEqual('calendar'); + expect(iconNameTel).toEqual('tel'); + }); + + it('should update array with right modules', () => { + let baseSkillssReferentiel = new Category(); + let accessRightsReferentiel = new Category(); + const mo1 = new Module('132', 'Uniquement sur RDV'); + const mo2 = new Module('145', 'Accès libre'); + const mo3 = new Module('112', 'Téléphone / Visio'); + const arrayModule: Module[] = [mo1, mo2, mo3]; + const m1 = new Module('260', 'm1'); + const m2 = new Module('259', 'm2'); + const m3 = new Module('261', 'm3'); + const m4 = new Module('249', 'm4'); + const m5 = new Module('222', 'm5'); + const arrayModuleBase: Module[] = [m1, m2, m3, m4, m5]; + baseSkillssReferentiel.name = 'categ2'; + baseSkillssReferentiel.modules = arrayModuleBase; + component.baseSkillssReferentiel = baseSkillssReferentiel; + accessRightsReferentiel.name = 'categ1'; + accessRightsReferentiel.modules = arrayModule; + component.accessRightsReferentiel = accessRightsReferentiel; + component.structure.lesCompetencesDeBase = ['260', '261']; + component.structure.accesAuxDroits = ['145', '112']; + component.setServiceCategories(); + expect(component.baseSkills).toEqual([m1, m3]); + expect(component.accessRights).toEqual([mo2, mo3]); + }); }); diff --git a/src/app/structure-list/components/structure-details/structure-details.component.ts b/src/app/structure-list/components/structure-details/structure-details.component.ts index 99d8e119cc3712552df98cdbf241ed29efcf2042..995d148ac0cef7c5f5d56353fe8e5c7ec8c5f1bd 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.ts +++ b/src/app/structure-list/components/structure-details/structure-details.component.ts @@ -72,15 +72,13 @@ export class StructureDetailsComponent implements OnInit { } public setServiceCategories(): void { - this.baseSkills = this.toNumbers(this.structure.lesCompetencesDeBase).map((skill) => + this.baseSkills = this.structure.lesCompetencesDeBase.map((skill) => _.find(this.baseSkillssReferentiel.modules, { id: skill }) ); - this.accessRights = this.toNumbers(this.structure.accesAuxDroits).map((rights) => + this.accessRights = this.structure.accesAuxDroits.map((rights) => _.find(this.accessRightsReferentiel.modules, { id: rights }) ); } public keepOriginalOrder = (a, b) => a.key; - - public toNumbers = (arr) => arr.map(Number); } diff --git a/src/app/structure-list/components/structure-opening-status/structure-opening-status.component.html b/src/app/structure-list/components/structure-opening-status/structure-opening-status.component.html index 384d443c5e6ac1173978280c867a0ebadae1c53d..e4be2e113a8801a29791adf78d1e5ac1a7ba242d 100644 --- a/src/app/structure-list/components/structure-opening-status/structure-opening-status.component.html +++ b/src/app/structure-list/components/structure-opening-status/structure-opening-status.component.html @@ -1,4 +1,10 @@ -<div class="statusStructure" [class]="isCalledByDetails ? 'details' : ''" fxLayout="row" fxLayoutAlign="start center"> +<div + class="statusStructure" + *ngIf="structure" + [class]="isCalledByDetails ? 'details' : ''" + fxLayout="row" + fxLayoutAlign="start center" +> <div> <span *ngIf="structure.isOpen; else closed" class="ico-dot-available"></span> <span class="text">{{ structure.openDisplay() }}</span> diff --git a/src/app/structure-list/models/category.model.ts b/src/app/structure-list/models/category.model.ts index 030f7fe827c535a481d2e8ff5eb6963edaf7e136..473e6e5d0ce523d25635a214749fd267e59c745d 100644 --- a/src/app/structure-list/models/category.model.ts +++ b/src/app/structure-list/models/category.model.ts @@ -6,7 +6,10 @@ export class Category { constructor(obj?: any) { Object.assign(this, obj, { - modules: obj && obj.modules ? obj.modules.map((module) => new Module(module.id, module.text)) : null, + modules: + obj && obj.modules + ? obj.modules.map((module) => new Module(module.display_id ? module.display_id : module.id, module.text)) + : null, }); } diff --git a/src/app/structure-list/services/search.service.spec.ts b/src/app/structure-list/services/search.service.spec.ts index 666955f99731e786af4843fb684ab70f5396b7ef..4504ad69b85983855ce0371759ca597316c4022b 100644 --- a/src/app/structure-list/services/search.service.spec.ts +++ b/src/app/structure-list/services/search.service.spec.ts @@ -25,13 +25,22 @@ describe('SearchService', () => { { id: '172', count: 1 }, { id: '173', count: 1 }, ]; - const m1: Module = { id: '176', text: 'strm1', count: 0 }; - const m2: Module = { id: '173', text: 'strm2', count: 0 }; - const m3: Module = { id: '172', text: 'strm3', count: 0 }; - const category: Category = { name: 'strCateg', modules: [m1, m2, m3] }; + const m1: Module = new Module('176', 'strm1'); + const m2: Module = new Module('173', 'strm2'); + const m3: Module = new Module('172', 'strm3'); + const category: Category = new Category({ name: 'strCateg', modules: [m1, m2, m3] }); const result = service.setCountModules(category, structureCount); expect(result.modules[0].count).toBe(2); expect(result.modules[1].count).toBe(1); expect(result.modules[2].count).toBe(1); }); + + it('should return an index about finding module', () => { + const m1: Module = new Module('176', 'strm1'); + const m2: Module = new Module('173', 'strm2'); + const m3: Module = new Module('172', 'strm3'); + const arrayModule: Module[] = [m1, m2, m3]; + const index = service.getIndex(arrayModule, m2.id, m2.text); + expect(index).toBe(1); + }); }); diff --git a/src/app/structure-list/services/search.service.ts b/src/app/structure-list/services/search.service.ts index de2252c1ff9c7b86c9c987b499b507a630659080..3f57cd50fdf4e9273328c9758b63f0fe1bae20e4 100644 --- a/src/app/structure-list/services/search.service.ts +++ b/src/app/structure-list/services/search.service.ts @@ -36,8 +36,6 @@ export class SearchService { public setCountModules(category: Category, structureCountTab: StructureCounter[]): Category { category.modules.forEach((m: Module) => { for (let i = 0; i < structureCountTab.length; i++) { - // Force type - m.id = m.id.toString(); if (structureCountTab[i].id === m.id) { m.count = structureCountTab[i].count; } diff --git a/src/app/structure-list/structure-list.component.spec.ts b/src/app/structure-list/structure-list.component.spec.ts index ea045c5516a8aa5f1f7d67582eb98a9298f73756..2cae39e9c048478c1c0fa5b8fc79ad53373cfe1a 100644 --- a/src/app/structure-list/structure-list.component.spec.ts +++ b/src/app/structure-list/structure-list.component.spec.ts @@ -2,13 +2,14 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { StyleUtils } from '@angular/flex-layout'; import { OpeningDay } from '../models/openingDay.model'; import { Structure } from '../models/structure.model'; +import { Filter } from './models/filter.model'; import { StructureListComponent } from './structure-list.component'; describe('StructureListComponent', () => { let component: StructureListComponent; let fixture: ComponentFixture<StructureListComponent>; - + let structure: Structure; beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [StructureListComponent], @@ -18,150 +19,149 @@ describe('StructureListComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(StructureListComponent); component = fixture.debugElement.componentInstance; - const structureList = new Array<Structure>( - new Structure({ - id: 1, - numero: '26-63', - dateDeCreation: '2020-10-08T15:17:00.000Z', - derniereModification: '2020-10-08T15:17:00.000Z', - nomDeLusager: 'Erwan Le luron', - votreStructureEstElle: 'Un établissement principal (siège social)', - nomDeVotreStructure: 'Régie de Quartier Armstrong', - typeDeStructure: 'Tiers-lieu & coworking, FabLab', - description: "Association loi 1901 dont l'objet est l'insertion par l'économie social et solidaire", - n: 2, - voie: 21356, - telephone: '04 72 21 03 07', - courriel: 'sguillet@rqa.fr', - siteWeb: '', - facebook: '', - twitter: '@rqainfo69', - instagram: '', - civilite: 'Madame', - nom: 'GUILLET', - prenom: 'Séverine', - fonction: 'Autres', - accessibilitePersonnesAMobiliteReduitePmr: '', - choixMultiples: 'Tout public', - fermeturesExceptionnelles: '', - jaccompagneLesUsagersDansLeursDemarchesEnLigne: 'True', - accompagnementDesDemarches: 'Accompagnant CAF', - autresAccompagnements: '', - lesCompetencesDeBase: 260, - accesAuxDroits: 176, - insertionSocialeEtProfessionnelle: 254, - aideALaParentalite: '', - cultureEtSecuriteNumerique: 264, - wifiEnAccesLibre: 'True', - ordinateurs: '', - nombre: '', - tablettes: '', - bornesNumeriques: '', - imprimantes: '', - autresEspacesProposesParLaStructure: 'Espace libre service', - statutJuridique: '', - appartenezVousAUnReseauDeMediation: '', - precisezLequel: '', - idDeLitemStructureDansDirectus: 123, - statutDeLitemStructureDansDirectus: '', - idDeLitemOffreDansDirectus: '', - statut: 'Erreur lors du versement des données offre', - hours: { - monday: { - open: true, - time: [ - { - openning: 1330, - closing: 1630, - }, - { - openning: null, - closing: null, - }, - ], - }, - tuesday: { - open: true, - time: [ - { - openning: 830, - closing: 1130, - }, - { - openning: 1330, - closing: 1630, - }, - ], - }, - wednesday: { - open: true, - time: [ - { - openning: 1330, - closing: 1630, - }, - { - openning: null, - closing: null, - }, - ], - }, - thursday: { - open: true, - time: [ - { - openning: 830, - closing: 1130, - }, - { - openning: 1330, - closing: 1630, - }, - ], - }, - friday: { - open: true, - time: [ - { - openning: 830, - closing: 1130, - }, - { - openning: 1330, - closing: 1530, - }, - ], - }, - saturday: { - open: false, - time: [ - { - openning: null, - closing: null, - }, - { - openning: null, - closing: null, - }, - ], - }, - sunday: { - open: false, - time: [ - { - openning: null, - closing: null, - }, - { - openning: null, - closing: null, - }, - ], - }, + structure = new Structure({ + id: 1, + numero: '26-63', + dateDeCreation: '2020-10-08T15:17:00.000Z', + derniereModification: '2020-10-08T15:17:00.000Z', + nomDeLusager: 'Erwan Le luron', + votreStructureEstElle: 'Un établissement principal (siège social)', + nomDeVotreStructure: 'Régie de Quartier Armstrong', + typeDeStructure: 'Tiers-lieu & coworking, FabLab', + description: "Association loi 1901 dont l'objet est l'insertion par l'économie social et solidaire", + n: 2, + voie: 21356, + telephone: '04 72 21 03 07', + courriel: 'sguillet@rqa.fr', + siteWeb: '', + facebook: '', + twitter: '@rqainfo69', + instagram: '', + civilite: 'Madame', + nom: 'GUILLET', + prenom: 'Séverine', + fonction: 'Autres', + accessibilitePersonnesAMobiliteReduitePmr: '', + choixMultiples: 'Tout public', + fermeturesExceptionnelles: '', + jaccompagneLesUsagersDansLeursDemarchesEnLigne: 'True', + accompagnementDesDemarches: 'Accompagnant CAF', + autresAccompagnements: '', + lesCompetencesDeBase: 260, + accesAuxDroits: 176, + insertionSocialeEtProfessionnelle: 254, + aideALaParentalite: '', + cultureEtSecuriteNumerique: 264, + wifiEnAccesLibre: 'True', + ordinateurs: '', + nombre: '', + tablettes: '', + bornesNumeriques: '', + imprimantes: '', + autresEspacesProposesParLaStructure: 'Espace libre service', + statutJuridique: '', + appartenezVousAUnReseauDeMediation: '', + precisezLequel: '', + idDeLitemStructureDansDirectus: 123, + statutDeLitemStructureDansDirectus: '', + idDeLitemOffreDansDirectus: '', + statut: 'Erreur lors du versement des données offre', + hours: { + monday: { + open: true, + time: [ + { + openning: 1330, + closing: 1630, + }, + { + openning: null, + closing: null, + }, + ], + }, + tuesday: { + open: true, + time: [ + { + openning: 830, + closing: 1130, + }, + { + openning: 1330, + closing: 1630, + }, + ], + }, + wednesday: { + open: true, + time: [ + { + openning: 1330, + closing: 1630, + }, + { + openning: null, + closing: null, + }, + ], + }, + thursday: { + open: true, + time: [ + { + openning: 830, + closing: 1130, + }, + { + openning: 1330, + closing: 1630, + }, + ], + }, + friday: { + open: true, + time: [ + { + openning: 830, + closing: 1130, + }, + { + openning: 1330, + closing: 1530, + }, + ], }, - openedOn: new OpeningDay('monday', null), - }) - ); + saturday: { + open: false, + time: [ + { + openning: null, + closing: null, + }, + { + openning: null, + closing: null, + }, + ], + }, + sunday: { + open: false, + time: [ + { + openning: null, + closing: null, + }, + { + openning: null, + closing: null, + }, + ], + }, + }, + openedOn: new OpeningDay('monday', null), + }); + const structureList = new Array<Structure>(structure); structureList.length = 4; component.structureList = structureList; fixture.detectChanges(); // calls NgOnit @@ -170,4 +170,43 @@ describe('StructureListComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should emit filters', () => { + const arr: Filter[] = []; + spyOn(component.searchEvent, 'emit'); + component.fetchResults(arr); + expect(component.searchEvent.emit).toHaveBeenCalled(); + expect(component.searchEvent.emit).toHaveBeenCalledWith(arr); + }); + + it('should emit id structure and update variables to open details', () => { + spyOn(component.selectedMarkerId, 'emit'); + component.showDetails(structure); + expect(component.selectedMarkerId.emit).toHaveBeenCalled(); + expect(component.selectedMarkerId.emit).toHaveBeenCalledWith(structure.id); + expect(component.showStructureDetails).toBe(true); + expect(component.structure).toBe(structure); + }); + + it('should emit id structure and update variables to close details', () => { + spyOn(component.selectedMarkerId, 'emit'); + component.closeDetails(); + expect(component.selectedMarkerId.emit).toHaveBeenCalled(); + expect(component.selectedMarkerId.emit).toHaveBeenCalledWith(); + expect(component.showStructureDetails).toBe(false); + }); + + it('should emit id structure to display map marker', () => { + spyOn(component.displayMapMarkerId, 'emit'); + component.handleCardHover(structure); + expect(component.displayMapMarkerId.emit).toHaveBeenCalled(); + expect(component.displayMapMarkerId.emit).toHaveBeenCalledWith([structure.id]); + }); + + it('should emit undefined id structure to remove map marker', () => { + spyOn(component.displayMapMarkerId, 'emit'); + component.mouseOut(); + expect(component.displayMapMarkerId.emit).toHaveBeenCalled(); + expect(component.displayMapMarkerId.emit).toHaveBeenCalledWith([undefined]); + }); });