Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #239 from admin-ch/feature/VACCINECER-2310-VACCINE…
Browse files Browse the repository at this point in the history
…CER-2252-VACCINECER-2307

Feature/vaccinecer 2310 vaccinecer 2252 vaccinecer 2307
  • Loading branch information
Armin-Isenring-Bit authored Aug 16, 2022
2 parents a35d59c + 16e4557 commit f685489
Show file tree
Hide file tree
Showing 22 changed files with 210 additions and 147 deletions.
40 changes: 27 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/app/auth/login-feedback.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ describe('LoginFeedbackComponent', () => {
let component: LoginFeedbackComponent;
let fixture: ComponentFixture<LoginFeedbackComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [LoginFeedbackComponent]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [LoginFeedbackComponent]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(LoginFeedbackComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ describe('WhoCheckboxComponent', () => {
let component: VaccinationImportantInformationComponent;
let fixture: ComponentFixture<VaccinationImportantInformationComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule, ReactiveFormsModule, MatCheckboxModule],
declarations: [VaccinationImportantInformationComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule, ReactiveFormsModule, MatCheckboxModule],
declarations: [VaccinationImportantInformationComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(VaccinationImportantInformationComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ describe('WhoCheckboxComponent', () => {
let component: WhoCheckboxComponent;
let fixture: ComponentFixture<WhoCheckboxComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule, ReactiveFormsModule, MatCheckboxModule],
declarations: [WhoCheckboxComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule, ReactiveFormsModule, MatCheckboxModule],
declarations: [WhoCheckboxComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(WhoCheckboxComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ describe('DateTimePickerComponent', () => {
let component: DateTimePickerComponent;
let fixture: ComponentFixture<DateTimePickerComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule, ReactiveFormsModule],
declarations: [DateTimePickerComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule, ReactiveFormsModule],
declarations: [DateTimePickerComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(DateTimePickerComponent);
Expand Down
44 changes: 23 additions & 21 deletions src/app/dashboard/dashboard.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,29 @@ describe('DashboardComponent', () => {
currentLang: 'en'
};

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule.withRoutes([
{
path: 'test',
component: DashboardComponent
}
]),
ObliqueTestingModule
],
declarations: [DashboardComponent, HasAuthorizationForMockDirective],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
providers: [
{provide: Router, useValue: router},
{provide: NotificationService, useValue: notificationServiceMock},
{provide: ObNotificationService, useValue: obNotificationServiceMock},
{provide: TranslateService, useValue: translateServiceMock}
]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule.withRoutes([
{
path: 'test',
component: DashboardComponent
}
]),
ObliqueTestingModule
],
declarations: [DashboardComponent, HasAuthorizationForMockDirective],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
providers: [
{provide: Router, useValue: router},
{provide: NotificationService, useValue: notificationServiceMock},
{provide: ObNotificationService, useValue: obNotificationServiceMock},
{provide: TranslateService, useValue: translateServiceMock}
]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
Expand Down
18 changes: 10 additions & 8 deletions src/app/eiam-self-admin/eiam-self-admin.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ describe('EiamSelfAdminComponent', () => {
let component: EiamSelfAdminComponent;
let fixture: ComponentFixture<EiamSelfAdminComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule],
declarations: [EiamSelfAdminComponent],
schemas: [NO_ERRORS_SCHEMA],
providers: [{provide: 'EIAM_SELF_ADMIN', useValue: 'prefix_CURRENT_PAGE_middle_LANGUAGE_suffix'}]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ObliqueTestingModule],
declarations: [EiamSelfAdminComponent],
schemas: [NO_ERRORS_SCHEMA],
providers: [{provide: 'EIAM_SELF_ADMIN', useValue: 'prefix_CURRENT_PAGE_middle_LANGUAGE_suffix'}]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(EiamSelfAdminComponent);
Expand Down
36 changes: 19 additions & 17 deletions src/app/notifications/notifications.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@ describe('NotificationsComponent', () => {
let component: NotificationsComponent;
let fixture: ComponentFixture<NotificationsComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [],
declarations: [NotificationsComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
providers: [
{
provide: NotificationService,
useValue: {
imminentNotifications$: new Subject()
}
},
{provide: ObNotificationService, useValue: {}},
{provide: TranslateService, useValue: {}}
]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [],
declarations: [NotificationsComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
providers: [
{
provide: NotificationService,
useValue: {
imminentNotifications$: new Subject()
}
},
{provide: ObNotificationService, useValue: {}},
{provide: TranslateService, useValue: {}}
]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(NotificationsComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<fieldset>
<legend>{{ "reports.dateFromTo.text" | translate }}</legend>
<legend>{{ label }}</legend>
<div class="period-container">
<mat-form-field>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {TranslateModule} from '@ngx-translate/core';
import {FormArray, FormControl, FormGroup} from '@angular/forms';
import {REPORT_ERROR_STATE_MATCHER} from '../../../errorStateMatcher';
import {ErrorStateMatcher} from '@angular/material/core';
import {ReportService} from "../../../report.service";
import {ReportType} from "shared/model";
import {Subject} from "rxjs";
import {ReportService} from '../../../report.service';
import {ReportType} from 'shared/model';
import {Subject} from 'rxjs';

describe('DateFromToFieldsetComponent', () => {
let component: DateFromToFieldsetComponent;
Expand All @@ -19,18 +19,21 @@ describe('DateFromToFieldsetComponent', () => {
await TestBed.configureTestingModule({
imports: [ObliqueTestingModule, TranslateModule],
declarations: [DateFromToFieldsetComponent],
providers: [{
provide: ReportService,
useValue: {
formGroup: new FormGroup({
[ReportType.A4]: new FormGroup({
from: new FormControl(''),
to: new FormControl(''),
})
}),
reset$: new Subject()
}
}, {provide: REPORT_ERROR_STATE_MATCHER, useClass: ErrorStateMatcher}],
providers: [
{
provide: ReportService,
useValue: {
formGroup: new FormGroup({
[ReportType.A4]: new FormGroup({
from: new FormControl(''),
to: new FormControl('')
})
}),
reset$: new Subject()
}
},
{provide: REPORT_ERROR_STATE_MATCHER, useClass: ErrorStateMatcher}
],
schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA]
}).compileComponents();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ import {FormControl} from '@angular/forms';
import * as moment from 'moment/moment';
import {ErrorStateMatcher} from '@angular/material/core';
import {REPORT_ERROR_STATE_MATCHER} from '../../../errorStateMatcher';
import {ReportService} from "../../../report.service";
import {Subscription} from "rxjs";
import {ReportService} from '../../../report.service';
import {Subscription} from 'rxjs';

@Component({
selector: 'ec-date-from-to-fieldset',
templateUrl: './date-from-to-fieldset.component.html',
styleUrls: ['./date-from-to-fieldset.component.scss']
})
export class DateFromToFieldsetComponent implements OnInit, OnDestroy {
@Input()
dateFromFormControl: FormControl;

@Input()
dateToFormControl: FormControl;
@Input() dateFromFormControl: FormControl;
@Input() dateToFormControl: FormControl;
@Input() label: string;

subscription: Subscription;

Expand All @@ -32,12 +30,12 @@ export class DateFromToFieldsetComponent implements OnInit, OnDestroy {

ngOnInit() {
this.subscription = this.reportService.reset$.subscribe(_ => {
this.dateFromFormControl.reset()
this.dateToFormControl.reset()
})
this.dateFromFormControl.reset();
this.dateToFormControl.reset();
});
}

ngOnDestroy() {
this.subscription?.unsubscribe()
this.subscription?.unsubscribe();
}
}
Loading

0 comments on commit f685489

Please sign in to comment.