-
Notifications
You must be signed in to change notification settings - Fork 219
/
_shell.component.spec.ts
90 lines (84 loc) · 3.1 KB
/
_shell.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateModule } from '@ngx-translate/core';
<% if (props.ui === 'ionic') { -%>
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { IonicModule } from '@ionic/angular';
<% } else if (props.ui === 'bootstrap') { -%>
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
<% } else if (props.ui === 'material') { -%>
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FlexLayoutModule } from '@angular/flex-layout';
import { MaterialModule } from '@app/material.module';
<% } -%>
import { CoreModule } from '@app/core';
<% if (props.auth) { -%>
import { AuthenticationService, CredentialsService } from '@app/auth';
import { MockAuthenticationService } from '@app/auth/authentication.service.mock';
import { MockCredentialsService } from '@app/auth/credentials.service.mock';
<% } -%>
import { ShellComponent } from './shell.component';
<% if (props.ui === 'ionic' && props.layout === 'tabs') { -%>
import { AboutComponent } from '@app/about/about.component';
import { SettingsComponent } from '@app/settings/settings.component';
import { HomeComponent } from '@app/home/home.component';
import { HomeModule } from '@app/home/home.module';
import { AboutModule } from '@app/about/about.module';
import { SettingsModule } from '@app/settings/settings.module';
<% } -%>
<% if (props.ui === 'bootstrap' || (props.ui === 'material' && props.layout === 'simple') || props.ui === 'raw') { -%>
import { HeaderComponent } from './header/header.component';
<% } -%>
describe('ShellComponent', () => {
let component: ShellComponent;
let fixture: ComponentFixture<ShellComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
TranslateModule.forRoot(),
<% if (props.ui === 'ionic') { -%>
IonicModule.forRoot(),
<% if (props.layout === 'tabs') { -%>
HomeModule,
AboutModule,
SettingsModule,
<% } -%>
<% } else if (props.ui === 'bootstrap') { -%>
NgbModule,
<% } else if (props.ui === 'material') { -%>
BrowserAnimationsModule,
FlexLayoutModule,
MaterialModule,
<% } -%>
CoreModule
],
<% if ((props.auth) || (props.ui === 'ionic')) { -%>
providers: [
<% if (props.auth) { -%>
{ provide: AuthenticationService, useClass: MockAuthenticationService },
{ provide: CredentialsService, useClass: MockCredentialsService }
<% } -%>
],
<% } -%>
<% if (props.ui === 'ionic') { -%>
schemas: [CUSTOM_ELEMENTS_SCHEMA],
<% } -%>
declarations: [
<% if (props.ui === 'bootstrap' || (props.ui === 'material' && props.layout === 'simple') || props.ui === 'raw') { -%>
HeaderComponent,
<% } -%>
ShellComponent
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ShellComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});