-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some basic unit tests to the examples app
- Loading branch information
1 parent
1c531ef
commit d2556be
Showing
28 changed files
with
783 additions
and
591 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
packages/examples/src/app/drag-layer/box-drag-preview/box-drag-preview.component.spec.ts
This file was deleted.
Oops, something went wrong.
45 changes: 28 additions & 17 deletions
45
packages/examples/src/app/drag-layer/custom-drag-layer/custom-drag-layer.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { | ||
default as TestBackendImpl, | ||
TestBackend | ||
} from 'react-dnd-test-backend'; | ||
import { SkyhookDndModule, DRAG_DROP_MANAGER } from 'angular-skyhook'; | ||
|
||
import { CustomDragLayerComponent } from './custom-drag-layer.component'; | ||
import { BoxDragPreviewComponent } from '../box-drag-preview/box-drag-preview.component'; | ||
import { BoxComponent } from '../box.component'; | ||
|
||
describe('CustomDragLayerComponent', () => { | ||
let component: CustomDragLayerComponent; | ||
let fixture: ComponentFixture<CustomDragLayerComponent>; | ||
describe('DragLayer => CustomDragLayerComponent', () => { | ||
let component: CustomDragLayerComponent; | ||
let fixture: ComponentFixture<CustomDragLayerComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ CustomDragLayerComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [SkyhookDndModule.forRoot({ backend: TestBackendImpl })], | ||
declarations: [ | ||
CustomDragLayerComponent, | ||
BoxDragPreviewComponent, | ||
BoxComponent | ||
] | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CustomDragLayerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CustomDragLayerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
49 changes: 32 additions & 17 deletions
49
packages/examples/src/app/drag-layer/drag-container/drag-container.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,40 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { | ||
default as TestBackendImpl, | ||
TestBackend | ||
} from 'react-dnd-test-backend'; | ||
import { SkyhookDndModule, DRAG_DROP_MANAGER } from 'angular-skyhook'; | ||
|
||
import { DragContainerComponent } from './drag-container.component'; | ||
import { DraggableBoxComponent } from '../draggable-box/draggable-box.component'; | ||
import { BoxComponent } from '../box.component'; | ||
import { CustomDragLayerComponent } from '../custom-drag-layer/custom-drag-layer.component'; | ||
import { BoxDragPreviewComponent } from '../box-drag-preview/box-drag-preview.component'; | ||
|
||
describe('DragContainerComponent', () => { | ||
let component: DragContainerComponent; | ||
let fixture: ComponentFixture<DragContainerComponent>; | ||
describe('DragLayer => DragContainerComponent', () => { | ||
let component: DragContainerComponent; | ||
let fixture: ComponentFixture<DragContainerComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DragContainerComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [SkyhookDndModule.forRoot({ backend: TestBackendImpl })], | ||
declarations: [ | ||
DragContainerComponent, | ||
DraggableBoxComponent, | ||
BoxComponent, | ||
CustomDragLayerComponent, | ||
BoxDragPreviewComponent | ||
] | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DragContainerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DragContainerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
40 changes: 23 additions & 17 deletions
40
packages/examples/src/app/drag-layer/draggable-box/draggable-box.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { | ||
default as TestBackendImpl, | ||
TestBackend | ||
} from 'react-dnd-test-backend'; | ||
import { SkyhookDndModule, DRAG_DROP_MANAGER } from 'angular-skyhook'; | ||
|
||
import { DraggableBoxComponent } from './draggable-box.component'; | ||
import { BoxComponent } from '../box.component'; | ||
|
||
describe('DraggableBoxComponent', () => { | ||
let component: DraggableBoxComponent; | ||
let fixture: ComponentFixture<DraggableBoxComponent>; | ||
describe('DragLayer => DraggableBoxComponent', () => { | ||
let component: DraggableBoxComponent; | ||
let fixture: ComponentFixture<DraggableBoxComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DraggableBoxComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [SkyhookDndModule.forRoot({ backend: TestBackendImpl })], | ||
declarations: [DraggableBoxComponent, BoxComponent] | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DraggableBoxComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DraggableBoxComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { | ||
SkyhookDndService, | ||
DropTargetSpec, | ||
AddSubscription, | ||
DropTarget, | ||
DragSource, | ||
DragSourceSpec, | ||
DragLayer | ||
} from 'angular-skyhook'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
@NgModule({ | ||
providers: [SkyhookDndService] | ||
}) | ||
export class SkyhookTestingModule {} |
Oops, something went wrong.