From e2b4f18fb9c50aeda3f0ba0ef4b0f1401eca50d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20QUAISSARD?= <mael.quaissard@smile.fr> Date: Wed, 16 Sep 2020 15:03:28 +0200 Subject: [PATCH] VITAM-UI-129 : Fix Unit tests Co-authored-by: benemart <benedicte.martinez@cea.fr> --- .../securisation-check-tab.component.spec.ts | 46 +++++++++++++++++++ ...itamui-select-all-option.component.spec.ts | 9 +++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index 5120b30a..d2c1bea9 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -47,6 +47,51 @@ describe('SecurisationCheckTabComponent', () => { let component: SecurisationCheckTabComponent; let fixture: ComponentFixture<SecurisationCheckTabComponent>; + const securisationValue = { + id: 'id', + idAppSession: 'idAppSession', + idRequest: 'idRequest', + parentId: 'parentId', + type: 'type', + typeProc: 'typeProc', + dateTime: new Date('1995-12-17'), + outcome: 'outcome', + outDetail: 'outDetail', + outMessage: 'outMessage', + data: 'data', + parsedData: { + Size: 2 + }, + objectId: 'objectId', + collectionName: 'collectionName', + agId: 'agId', + agIdApp: 'agIdApp', + agIdExt: 'agIdExt', + rightsStatementIdentifier: 'rightsStatementIdentifier', + events: [{ + id: 'id2', + idAppSession: 'idAppSession2', + idRequest: 'idRequest2', + parentId: 'id', + type: 'type', + typeProc: 'typeProc', + dateTime: new Date('1995-12-17'), + outcome: 'outcome', + outDetail: 'outDetail', + outMessage: 'outMessage', + data: 'data', + parsedData: { + dataKey: 'dataValue' + }, + objectId: 'objectId', + collectionName: 'collectionName', + agId: 'agId', + agIdApp: 'agIdApp', + agIdExt: 'agIdExt', + rightsStatementIdentifier: 'rightsStatementIdentifier' + }] + }; + beforeEach(async(() => { const activatedRouteMock = { params: of({tenantIdentifier: 1}), @@ -72,6 +117,7 @@ describe('SecurisationCheckTabComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(SecurisationCheckTabComponent); component = fixture.componentInstance; + component.securisation = securisationValue; fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-select-all-option/vitamui-select-all-option.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-select-all-option/vitamui-select-all-option.component.spec.ts index 4a69195c..68eca48a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-select-all-option/vitamui-select-all-option.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-select-all-option/vitamui-select-all-option.component.spec.ts @@ -1,13 +1,20 @@ +import { CommonModule } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - +import { MatPseudoCheckboxModule, MatRippleModule } from '@angular/material/core'; import { VitamUISelectAllOptionComponent } from './vitamui-select-all-option.component'; + describe('VitamuiSelectAllOptionComponent', () => { let component: VitamUISelectAllOptionComponent; let fixture: ComponentFixture<VitamUISelectAllOptionComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ + imports: [ + CommonModule, + MatPseudoCheckboxModule, + MatRippleModule + ], declarations: [ VitamUISelectAllOptionComponent ] }) .compileComponents(); -- GitLab