/
request-reminder.component.spec.ts
50 lines (42 loc) · 1.97 KB
/
request-reminder.component.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateModule } from '@ngx-translate/core';
import { MockComponent } from 'ng-mocks';
import { ServerHtmlDirective } from 'ish-core/directives/server-html.directive';
import { coreReducers } from 'ish-core/store/core-store.module';
import { ngrxTesting } from 'ish-core/utils/dev/ngrx-testing';
import { LoadingComponent } from 'ish-shared/components/common/loading/loading.component';
import { RequestReminderFormComponent } from '../request-reminder-form/request-reminder-form.component';
import { UpdatePasswordFormComponent } from '../update-password-form/update-password-form.component';
import { RequestReminderComponent } from './request-reminder.component';
describe('Request Reminder Component', () => {
let component: RequestReminderComponent;
let fixture: ComponentFixture<RequestReminderComponent>;
let element: HTMLElement;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
MockComponent(LoadingComponent),
MockComponent(RequestReminderFormComponent),
MockComponent(ServerHtmlDirective),
MockComponent(UpdatePasswordFormComponent),
RequestReminderComponent,
],
imports: [RouterTestingModule, TranslateModule.forRoot(), ngrxTesting({ reducers: coreReducers })],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RequestReminderComponent);
component = fixture.componentInstance;
element = fixture.nativeElement;
});
it('should be created', () => {
expect(component).toBeTruthy();
expect(element).toBeTruthy();
expect(() => fixture.detectChanges()).not.toThrow();
});
it('should render request reminder form on forgot-password request reminder page', async(() => {
fixture.detectChanges();
expect(element.querySelector('ish-request-reminder-form')).toBeTruthy();
}));
});