Skip to content

Commit

Permalink
feat(testForComponents): pass tests for all components
Browse files Browse the repository at this point in the history
  • Loading branch information
afontainec committed Oct 19, 2020
1 parent 470c6c5 commit 21664c9
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 2 deletions.
32 changes: 32 additions & 0 deletions example/views/angular/edit/spec.ts
@@ -0,0 +1,32 @@
import { RouterTestingModule } from '@angular/router/testing';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { HttpClient } from '@angular/common/http';
import { FormsModule } from '@angular/forms';

import { Edit$PASCAL_CASE$Component } from './edit-$KEBAB_CASE$.component';

describe('Edit$PASCAL_CASE$ComponentComponent', () => {
let httpClient: HttpClient;
let component: Edit$PASCAL_CASE$Component;
let fixture: ComponentFixture<Edit$PASCAL_CASE$Component>;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ HttpClientTestingModule, RouterTestingModule, FormsModule ],
declarations: [ Edit$PASCAL_CASE$Component ]
})
.compileComponents();
}));

beforeEach(() => {
httpClient = TestBed.get(HttpClient);
fixture = TestBed.createComponent(Edit$PASCAL_CASE$Component);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
5 changes: 3 additions & 2 deletions example/views/angular/index/spec.ts
@@ -1,7 +1,8 @@
import { RouterTestingModule } from '@angular/router/testing';
import { FormsModule } from '@angular/forms';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { HttpClient } from '@angular/common/http';
import { RouterModule } from '@angular/router';

import { Index$PASCAL_CASE$Component } from './index-$KEBAB_CASE$.component';

Expand All @@ -12,7 +13,7 @@ describe('Index$PASCAL_CASE$ComponentComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ HttpClientTestingModule, RouterModule ],
imports: [ HttpClientTestingModule, RouterTestingModule, FormsModule ],
declarations: [ Index$PASCAL_CASE$Component ]
})
.compileComponents();
Expand Down
33 changes: 33 additions & 0 deletions example/views/angular/new/spec.ts
@@ -0,0 +1,33 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { HttpClient } from '@angular/common/http';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';

import { New$PASCAL_CASE$Component } from './new-$KEBAB_CASE$.component';

describe('New$PASCAL_CASE$ComponentComponent', () => {
let httpClient: HttpClient;
let component: New$PASCAL_CASE$Component;
let fixture: ComponentFixture<New$PASCAL_CASE$Component>;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ HttpClientTestingModule, RouterTestingModule, FormsModule ],
declarations: [ New$PASCAL_CASE$Component ]
})
.compileComponents();
}));

beforeEach(() => {
httpClient = TestBed.get(HttpClient);
fixture = TestBed.createComponent(New$PASCAL_CASE$Component);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
32 changes: 32 additions & 0 deletions example/views/angular/show/spec.ts
@@ -1 +1,33 @@

import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { HttpClient } from '@angular/common/http';
import { RouterTestingModule } from '@angular/router/testing';
import { FormsModule } from '@angular/forms';

import { Show$PASCAL_CASE$Component } from './show-$KEBAB_CASE$.component';

describe('Show$PASCAL_CASE$ComponentComponent', () => {
let httpClient: HttpClient;
let component: Show$PASCAL_CASE$Component;
let fixture: ComponentFixture<Show$PASCAL_CASE$Component>;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ HttpClientTestingModule, RouterTestingModule, FormsModule ],
declarations: [ Show$PASCAL_CASE$Component ]
})
.compileComponents();
}));

beforeEach(() => {
httpClient = TestBed.get(HttpClient);
fixture = TestBed.createComponent(Show$PASCAL_CASE$Component);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

0 comments on commit 21664c9

Please sign in to comment.