-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved plan components to its directory
- Loading branch information
Showing
60 changed files
with
355 additions
and
353 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 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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
124 changes: 62 additions & 62 deletions
124
...ner/src/app/depth/depth.component.spec.ts → ...rc/app/plan/depth/depth.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,62 +1,62 @@ | ||
import { DecimalPipe } from '@angular/common'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { By } from '@angular/platform-browser'; | ||
import { InputControls } from '../shared/inputcontrols'; | ||
import { UnitConversion } from '../shared/UnitConversion'; | ||
import { ValidatorGroups } from '../shared/ValidatorGroups'; | ||
import { DepthComponent } from './depth.component'; | ||
|
||
export class DepthPage { | ||
constructor(private fixture: ComponentFixture<DepthComponent>) { } | ||
|
||
public get depthInput(): HTMLInputElement { | ||
return this.fixture.debugElement.query(By.css('#depthField')).nativeElement as HTMLInputElement; | ||
} | ||
|
||
public get applyMaxDepthButton(): HTMLButtonElement { | ||
return this.fixture.debugElement.query(By.css('#applyMaxDepthBtn')).nativeElement as HTMLButtonElement; | ||
} | ||
} | ||
|
||
describe('DepthComponent', () => { | ||
let component: DepthComponent; | ||
let fixture: ComponentFixture<DepthComponent>; | ||
let page: DepthPage; | ||
let changeFired: boolean; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DepthComponent], | ||
imports: [ReactiveFormsModule], | ||
providers: [ | ||
UnitConversion, ValidatorGroups, | ||
InputControls, DecimalPipe | ||
] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DepthComponent); | ||
page = new DepthPage(fixture); | ||
component = fixture.componentInstance; | ||
component.units.imperialUnits = true; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('Fires value changed', () => { | ||
component.depthChange.subscribe(() => changeFired = true); | ||
changeFired = false; | ||
page.depthInput.value = '70'; | ||
page.depthInput.dispatchEvent(new Event('input')); | ||
expect(changeFired).toBeTruthy(); | ||
}); | ||
|
||
it('Fires apply max depth', () => { | ||
let eventFired = false; | ||
component.assignMaxDepth.subscribe(() => eventFired = true); | ||
page.applyMaxDepthButton.click(); | ||
expect(eventFired).toBeTruthy(); | ||
}); | ||
}); | ||
import { DecimalPipe } from '@angular/common'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { By } from '@angular/platform-browser'; | ||
import { InputControls } from '../../shared/inputcontrols'; | ||
import { UnitConversion } from '../../shared/UnitConversion'; | ||
import { ValidatorGroups } from '../../shared/ValidatorGroups'; | ||
import { DepthComponent } from './depth.component'; | ||
|
||
export class DepthPage { | ||
constructor(private fixture: ComponentFixture<DepthComponent>) { } | ||
|
||
public get depthInput(): HTMLInputElement { | ||
return this.fixture.debugElement.query(By.css('#depthField')).nativeElement as HTMLInputElement; | ||
} | ||
|
||
public get applyMaxDepthButton(): HTMLButtonElement { | ||
return this.fixture.debugElement.query(By.css('#applyMaxDepthBtn')).nativeElement as HTMLButtonElement; | ||
} | ||
} | ||
|
||
describe('DepthComponent', () => { | ||
let component: DepthComponent; | ||
let fixture: ComponentFixture<DepthComponent>; | ||
let page: DepthPage; | ||
let changeFired: boolean; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DepthComponent], | ||
imports: [ReactiveFormsModule], | ||
providers: [ | ||
UnitConversion, ValidatorGroups, | ||
InputControls, DecimalPipe | ||
] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DepthComponent); | ||
page = new DepthPage(fixture); | ||
component = fixture.componentInstance; | ||
component.units.imperialUnits = true; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('Fires value changed', () => { | ||
component.depthChange.subscribe(() => changeFired = true); | ||
changeFired = false; | ||
page.depthInput.value = '70'; | ||
page.depthInput.dispatchEvent(new Event('input')); | ||
expect(changeFired).toBeTruthy(); | ||
}); | ||
|
||
it('Fires apply max depth', () => { | ||
let eventFired = false; | ||
component.assignMaxDepth.subscribe(() => eventFired = true); | ||
page.applyMaxDepthButton.click(); | ||
expect(eventFired).toBeTruthy(); | ||
}); | ||
}); |
6 changes: 3 additions & 3 deletions
6
.../planner/src/app/depth/depth.component.ts → ...ner/src/app/plan/depth/depth.component.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
File renamed without changes.
File renamed without changes.
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 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
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.