Skip to content

Commit eb01fd6

Browse files
Abderrahmane Hamilammalerba
Abderrahmane Hamila
authored andcommitted
test(cdk-stepper): preselected value should be number
1 parent d5975cf commit eb01fd6

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
@@ -704,13 +704,26 @@ describe('MatStepper', () => {
704704

705705
describe('linear stepper with a pre-defined selectedIndex', () => {
706706
let preselectedFixture: ComponentFixture<SimplePreselectedMatHorizontalStepperApp>;
707+
let stepper: MatHorizontalStepper;
708+
707709
beforeEach(() => {
708710
preselectedFixture = createComponent(SimplePreselectedMatHorizontalStepperApp);
711+
preselectedFixture.detectChanges();
712+
stepper = preselectedFixture.debugElement
713+
.query(By.directive(MatHorizontalStepper)).componentInstance;
709714
});
710715

711716
it('should not throw', () => {
712717
expect(() => preselectedFixture.detectChanges()).not.toThrow();
713718
});
719+
720+
it('selectedIndex should be typeof number', () => {
721+
expect(typeof stepper.selectedIndex).toBe('number');
722+
});
723+
724+
it('value of selectedIndex should be the pre-defined value', () => {
725+
expect(stepper.selectedIndex).toBe(0);
726+
});
714727
});
715728

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

0 commit comments

Comments
 (0)