File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
material-experimental/mdc-select Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ describe('MDC-based MatSelect', () => {
8989 * that we're only compiling the necessary test components for each test in order to speed up
9090 * overall test time.
9191 * @param declarations Components to declare for this block
92+ * @param providers Additional providers for this block
9293 */
9394 function configureMatSelectTestingModule ( declarations : any [ ] , providers : Provider [ ] = [ ] ) {
9495 TestBed . configureTestingModule ( {
@@ -1088,7 +1089,7 @@ describe('MDC-based MatSelect', () => {
10881089
10891090 options [ 1 ] . click ( ) ;
10901091 fixture . detectChanges ( ) ;
1091- trigger . click ( ) ;
1092+ fixture . componentInstance . select . open ( ) ;
10921093 fixture . detectChanges ( ) ;
10931094 flush ( ) ;
10941095
@@ -1100,10 +1101,13 @@ describe('MDC-based MatSelect', () => {
11001101
11011102 fixture . componentInstance . control . setValue ( fixture . componentInstance . foods [ 7 ] . value ) ;
11021103 fixture . detectChanges ( ) ;
1103- trigger . click ( ) ;
1104+ fixture . componentInstance . select . close ( ) ;
11041105 fixture . detectChanges ( ) ;
11051106 flush ( ) ;
11061107
1108+ fixture . componentInstance . select . open ( ) ;
1109+ fixture . detectChanges ( ) ;
1110+
11071111 activeOptions = options . filter ( option => {
11081112 return option . classList . contains ( 'mat-mdc-option-active' ) ;
11091113 } ) ;
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ describe('MatSelect', () => {
9191 * that we're only compiling the necessary test components for each test in order to speed up
9292 * overall test time.
9393 * @param declarations Components to declare for this block
94+ * @param providers Additional providers for this block
9495 */
9596 function configureMatSelectTestingModule ( declarations : any [ ] , providers : Provider [ ] = [ ] ) {
9697 TestBed . configureTestingModule ( {
@@ -1088,7 +1089,7 @@ describe('MatSelect', () => {
10881089
10891090 options [ 1 ] . click ( ) ;
10901091 fixture . detectChanges ( ) ;
1091- trigger . click ( ) ;
1092+ fixture . componentInstance . select . open ( ) ;
10921093 fixture . detectChanges ( ) ;
10931094 flush ( ) ;
10941095
@@ -1098,10 +1099,13 @@ describe('MatSelect', () => {
10981099
10991100 fixture . componentInstance . control . setValue ( fixture . componentInstance . foods [ 7 ] . value ) ;
11001101 fixture . detectChanges ( ) ;
1101- trigger . click ( ) ;
1102+ fixture . componentInstance . select . close ( ) ;
11021103 fixture . detectChanges ( ) ;
11031104 flush ( ) ;
11041105
1106+ fixture . componentInstance . select . open ( ) ;
1107+ fixture . detectChanges ( ) ;
1108+
11051109 activeOptions = options . filter ( option => option . classList . contains ( 'mat-active' ) ) ;
11061110 expect ( activeOptions ) . toEqual ( [ options [ 7 ] ] ,
11071111 'Expected only selected option to be marked as active after the value has changed.' ) ;
You can’t perform that action at this time.
0 commit comments