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', () => {
89
89
* that we're only compiling the necessary test components for each test in order to speed up
90
90
* overall test time.
91
91
* @param declarations Components to declare for this block
92
+ * @param providers Additional providers for this block
92
93
*/
93
94
function configureMatSelectTestingModule ( declarations : any [ ] , providers : Provider [ ] = [ ] ) {
94
95
TestBed . configureTestingModule ( {
@@ -1088,7 +1089,7 @@ describe('MDC-based MatSelect', () => {
1088
1089
1089
1090
options [ 1 ] . click ( ) ;
1090
1091
fixture . detectChanges ( ) ;
1091
- trigger . click ( ) ;
1092
+ fixture . componentInstance . select . open ( ) ;
1092
1093
fixture . detectChanges ( ) ;
1093
1094
flush ( ) ;
1094
1095
@@ -1100,10 +1101,13 @@ describe('MDC-based MatSelect', () => {
1100
1101
1101
1102
fixture . componentInstance . control . setValue ( fixture . componentInstance . foods [ 7 ] . value ) ;
1102
1103
fixture . detectChanges ( ) ;
1103
- trigger . click ( ) ;
1104
+ fixture . componentInstance . select . close ( ) ;
1104
1105
fixture . detectChanges ( ) ;
1105
1106
flush ( ) ;
1106
1107
1108
+ fixture . componentInstance . select . open ( ) ;
1109
+ fixture . detectChanges ( ) ;
1110
+
1107
1111
activeOptions = options . filter ( option => {
1108
1112
return option . classList . contains ( 'mat-mdc-option-active' ) ;
1109
1113
} ) ;
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ describe('MatSelect', () => {
91
91
* that we're only compiling the necessary test components for each test in order to speed up
92
92
* overall test time.
93
93
* @param declarations Components to declare for this block
94
+ * @param providers Additional providers for this block
94
95
*/
95
96
function configureMatSelectTestingModule ( declarations : any [ ] , providers : Provider [ ] = [ ] ) {
96
97
TestBed . configureTestingModule ( {
@@ -1088,7 +1089,7 @@ describe('MatSelect', () => {
1088
1089
1089
1090
options [ 1 ] . click ( ) ;
1090
1091
fixture . detectChanges ( ) ;
1091
- trigger . click ( ) ;
1092
+ fixture . componentInstance . select . open ( ) ;
1092
1093
fixture . detectChanges ( ) ;
1093
1094
flush ( ) ;
1094
1095
@@ -1098,10 +1099,13 @@ describe('MatSelect', () => {
1098
1099
1099
1100
fixture . componentInstance . control . setValue ( fixture . componentInstance . foods [ 7 ] . value ) ;
1100
1101
fixture . detectChanges ( ) ;
1101
- trigger . click ( ) ;
1102
+ fixture . componentInstance . select . close ( ) ;
1102
1103
fixture . detectChanges ( ) ;
1103
1104
flush ( ) ;
1104
1105
1106
+ fixture . componentInstance . select . open ( ) ;
1107
+ fixture . detectChanges ( ) ;
1108
+
1105
1109
activeOptions = options . filter ( option => option . classList . contains ( 'mat-active' ) ) ;
1106
1110
expect ( activeOptions ) . toEqual ( [ options [ 7 ] ] ,
1107
1111
'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