File tree 1 file changed +10
-0
lines changed
src/material-experimental/mdc-select
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -3093,6 +3093,15 @@ describe('MDC-based MatSelect', () => {
3093
3093
3094
3094
expect ( trigger . textContent ) . not . toContain ( 'Pizza' ) ;
3095
3095
} ) ) ;
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
+ } ) ) ;
3096
3105
} ) ;
3097
3106
3098
3107
describe ( 'with custom trigger' , ( ) => {
@@ -4439,6 +4448,7 @@ class BasicSelectOnPush {
4439
4448
` ,
4440
4449
} )
4441
4450
class BasicSelectOnPushPreselected {
4451
+ @ViewChild ( MatSelect ) select : MatSelect ;
4442
4452
foods : any [ ] = [
4443
4453
{ value : 'steak-0' , viewValue : 'Steak' } ,
4444
4454
{ value : 'pizza-1' , viewValue : 'Pizza' } ,
You can’t perform that action at this time.
0 commit comments