Skip to content

Commit f63d669

Browse files
authored
build: add missing test (#24219)
Fixes a failure in the lint check due to a missing unit test.
1 parent 99c6112 commit f63d669

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/material-experimental/mdc-select/select.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,6 +3093,15 @@ describe('MDC-based MatSelect', () => {
30933093

30943094
expect(trigger.textContent).not.toContain('Pizza');
30953095
}));
3096+
3097+
it('should sync up the form control value with the component value', fakeAsync(() => {
3098+
const fixture = TestBed.createComponent(BasicSelectOnPushPreselected);
3099+
fixture.detectChanges();
3100+
flush();
3101+
3102+
expect(fixture.componentInstance.control.value).toBe('pizza-1');
3103+
expect(fixture.componentInstance.select.value).toBe('pizza-1');
3104+
}));
30963105
});
30973106

30983107
describe('with custom trigger', () => {
@@ -4439,6 +4448,7 @@ class BasicSelectOnPush {
44394448
`,
44404449
})
44414450
class BasicSelectOnPushPreselected {
4451+
@ViewChild(MatSelect) select: MatSelect;
44424452
foods: any[] = [
44434453
{value: 'steak-0', viewValue: 'Steak'},
44444454
{value: 'pizza-1', viewValue: 'Pizza'},

0 commit comments

Comments
 (0)