Skip to content

Commit 0777887

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

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

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

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

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

0 commit comments

Comments
 (0)