Skip to content

Commit

Permalink
test(cdk-stepper): preselected value should be number
Browse files Browse the repository at this point in the history
  • Loading branch information
s2-abdo authored and mmalerba committed Jan 23, 2019
1 parent d5975cf commit eb01fd6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lib/stepper/stepper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,13 +704,26 @@ describe('MatStepper', () => {

describe('linear stepper with a pre-defined selectedIndex', () => {
let preselectedFixture: ComponentFixture<SimplePreselectedMatHorizontalStepperApp>;
let stepper: MatHorizontalStepper;

beforeEach(() => {
preselectedFixture = createComponent(SimplePreselectedMatHorizontalStepperApp);
preselectedFixture.detectChanges();
stepper = preselectedFixture.debugElement
.query(By.directive(MatHorizontalStepper)).componentInstance;
});

it('should not throw', () => {
expect(() => preselectedFixture.detectChanges()).not.toThrow();
});

it('selectedIndex should be typeof number', () => {
expect(typeof stepper.selectedIndex).toBe('number');
});

it('value of selectedIndex should be the pre-defined value', () => {
expect(stepper.selectedIndex).toBe(0);
});
});

describe('linear stepper with no `stepControl`', () => {
Expand Down

0 comments on commit eb01fd6

Please sign in to comment.