Skip to content

Commit 348a0d3

Browse files
author
Abderrahmane Hamila
committed
test(cdk-stepper): preselected value should be number
1 parent 891b4ac commit 348a0d3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/lib/stepper/stepper.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,26 @@ describe('MatStepper', () => {
699699

700700
describe('linear stepper with a pre-defined selectedIndex', () => {
701701
let preselectedFixture: ComponentFixture<SimplePreselectedMatHorizontalStepperApp>;
702+
let stepper: MatHorizontalStepper;
703+
702704
beforeEach(() => {
703705
preselectedFixture = createComponent(SimplePreselectedMatHorizontalStepperApp);
706+
preselectedFixture.detectChanges();
707+
stepper = preselectedFixture.debugElement
708+
.query(By.directive(MatHorizontalStepper)).componentInstance;
704709
});
705710

706711
it('should not throw', () => {
707712
expect(() => preselectedFixture.detectChanges()).not.toThrow();
708713
});
714+
715+
it('selectedIndex should be typeof number', () => {
716+
expect(typeof stepper.selectedIndex).toBe('number');
717+
});
718+
719+
it('value of selectedIndex should be the pre-defined value', () => {
720+
expect(stepper.selectedIndex).toBe(0);
721+
});
709722
});
710723

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

0 commit comments

Comments
 (0)