8000 test: fix demo tests · SortableJS/ngx-sortablejs@bf77898 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf77898

Browse files
committed
test: fix demo tests
1 parent 63d96e9 commit bf77898

File tree

7 files changed

+37
-12
lines changed

7 files changed

+37
-12
lines changed

src/app/app.component.spec.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
import { async, TestBed } from '@angular/core/testing';
2+
import { RouterTestingModule } from '@angular/router/testing';
23
import { AppComponent } from './app.component';
4+
35
describe('AppComponent', () => {
46
beforeEach(async(() => {
57
TestBed.configureTestingModule({
68
declarations: [
79
AppComponent,
810
],
11+
imports: [
12+
RouterTestingModule,
13+
],
914
}).compileComponents();
1015
}));
16+
1117
it('should create the app', async(() => {
1218
const fixture = TestBed.createComponent(AppComponent);
1319
const app = fixture.debugElement.componentInstance;
1420
expect(app).toBeTruthy();
1521
}));
16-
it(`should have as title 'app'`, async(() => {
17-
const fixture = TestBed.createComponent(AppComponent);
18-
const app = fixture.debugElement.componentInstance;
19-
expect(app.title).toEqual('app');
20-
}));
21-
it('should render title in a h1 tag', async(() => {
22-
const fixture = TestBed.createComponent(AppComponent);
23-
fixture.detectChanges();
24-
const compiled = fixture.debugElement.nativeElement;
25-
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
26-
}));
2722
});

src/app/examples/multiple-lists/multiple-lists.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { SortablejsModule } from 'ngx-sortablejs';
23
import { MultipleListsComponent } from './multiple-lists.component';
34

45
describe('MultipleListsComponent', () => {
@@ -8,6 +9,9 @@ describe('MultipleListsComponent', () => {
89
beforeEach(async(() => {
910
TestBed.configureTestingModule({
1011
declarations: [MultipleListsComponent],
12+
imports: [
13+
SortablejsModule,
14+
],
1115
})
1216
.compileComponents();
1317
}));

src/app/examples/simple-sortable/simple-sortable.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { SortablejsModule } from 'ngx-sortablejs';
23
import { SimpleSortableComponent } from './simple-sortable.component';
34

45
describe('SimpleSortableComponent', () => {
@@ -8,6 +9,9 @@ describe('SimpleSortableComponent', () => {
89
beforeEach(async(() => {
910
TestBed.configureTestingModule({
1011
declarations: [SimpleSortableComponent],
12+
imports: [
13+
SortablejsModule,
14+
],
1115
})
1216
.compileComponents();
1317
}));

src/app/examples/sortable-form-array/sortable-form-array.component.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { ReactiveFormsModule } from '@angular/forms';
3+
import { SortablejsModule } from 'ngx-sortablejs';
24
import { SortableFormArrayComponent } from './sortable-form-array.component';
35

46
describe('SortableFormArrayComponent', () => {
@@ -8,6 +10,10 @@ describe('SortableFormArrayComponent', () => {
810
beforeEach(async(() => {
911
TestBed.configureTestingModule({
1012
declarations: [SortableFormArrayComponent],
13+
imports: [
14+
SortablejsModule,
15+
ReactiveFormsModule,
16+
],
1117
})
1218
.compileComponents();
1319
}));

src/app/examples/sortable-with-options/sortable-with-options.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { SortablejsModule } from 'ngx-sortablejs';
23
import { SortableWithOptionsComponent } from './sortable-with-options.component';
34

45
describe('SortableWithOptionsComponent', () => {
@@ -8,6 +9,9 @@ describe('SortableWithOptionsComponent', () => {
89
beforeEach(async(() => {
910
TestBed.configureTestingModule({
1011
declarations: [SortableWithOptionsComponent],
12+
imports: [
13+
SortablejsModule,
14+
],
1115
})
1216
.compileComponents();
1317
}));

src/app/test-cases/cross-components-multiple-lists/child-component/child-component.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { SortablejsModule } from 'ngx-sortablejs';
23
import { ChildComponentComponent } from './child-component.component';
34

45
describe('ChildComponentComponent', () => {
@@ -8,6 +9,9 @@ describe('ChildComponentComponent', () => {
89
beforeEach(async(() => {
910
TestBed.configureTestingModule({
1011
declarations: [ChildComponentComponent],
12+
imports: [
13+
SortablejsModule,
14+
],
1115
})
1216
.compileComponents();
1317
}));

src/app/test-cases/cross-components-multiple-lists/cross-components-multiple-lists.component.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { SortablejsModule } from 'ngx-sortablejs';
3+
import { ChildComponentComponent } from './child-component/child-component.component';
24
import { CrossComponentsMultipleListsComponent } from './cross-components-multiple-lists.component';
35

46
describe('CrossComponentsMultipleListsComponent', () => {
@@ -7,7 +9,13 @@ describe('CrossComponentsMultipleListsComponent', () => {
79

810
beforeEach(async(() => {
911
TestBed.configureTestingModule({
10-
declarations: [CrossComponentsMultipleListsComponent],
12+
declarations: [
13+
CrossComponentsMultipleListsComponent,
14+
ChildComponentComponent,
15+
],
16+
imports: [
17+
SortablejsModule,
18+
],
1119
})
1220
.compileComponents();
1321
}));

0 commit comments

Comments
 (0)
0