File tree Expand file tree Collapse file tree 7 files changed +30
-2
lines changed
src/material-experimental Expand file tree Collapse file tree 7 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ function runTests() {
112
112
// Older versions of Edge have a bug where `disabled` buttons are still clickable if
113
113
// they contain child elements. We skip this check on Edge.
114
114
// See https://stackoverflow.com/questions/32377026/disabled-button-is-clickable-on-edge-browser
115
- if ( platform . EDGE ) {
115
+ if ( platform . EDGE || platform . FIREFOX ) {
116
116
return ;
117
117
}
118
118
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ ng_test_library(
73
73
":mdc-checkbox" ,
74
74
"//src/cdk-experimental/testing" ,
75
75
"//src/cdk-experimental/testing/testbed" ,
76
+ "//src/cdk/platform" ,
76
77
"//src/cdk/testing" ,
77
78
"//src/material/checkbox" ,
78
79
"@npm//@angular/forms" ,
Original file line number Diff line number Diff line change
1
+ import { Platform } from '@angular/cdk/platform' ;
1
2
import { HarnessLoader } from '@angular/cdk-experimental/testing' ;
2
3
import { TestbedHarnessEnvironment } from '@angular/cdk-experimental/testing/testbed' ;
3
4
import { Component } from '@angular/core' ;
@@ -8,6 +9,7 @@ import {MatCheckboxModule as MatMdcCheckboxModule} from '../index';
8
9
import { MatCheckboxHarness } from './checkbox-harness' ;
9
10
import { MatCheckboxHarness as MatMdcCheckboxHarness } from './mdc-checkbox-harness' ;
10
11
12
+ const platform = new Platform ( ) ;
11
13
let fixture : ComponentFixture < CheckboxHarnessTest > ;
12
14
let loader : HarnessLoader ;
13
15
let checkboxHarness : typeof MatCheckboxHarness ;
@@ -178,6 +180,12 @@ function runTests() {
178
180
} ) ;
179
181
180
182
it ( 'should not toggle disabled checkbox' , async ( ) => {
183
+ if ( platform . FIREFOX ) {
184
+ // do run this test on firefox as click events on the label of a disabled checkbox
185
+ // cause the value to be changed. https://bugzilla.mozilla.org/show_bug.cgi?id=1540995
186
+ return ;
187
+ }
188
+
181
189
const disabledCheckbox = await loader . getHarness ( checkboxHarness . with ( { label : 'Second' } ) ) ;
182
190
expect ( await disabledCheckbox . isChecked ( ) ) . toBe ( false ) ;
183
191
await disabledCheckbox . toggle ( ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ ng_test_library(
21
21
":harness" ,
22
22
"//src/cdk-experimental/testing" ,
23
23
"//src/cdk-experimental/testing/testbed" ,
24
+ "//src/cdk/platform" ,
24
25
"//src/material/radio" ,
25
26
"@npm//@angular/forms" ,
26
27
],
Original file line number Diff line number Diff line change
1
+ import { Platform } from '@angular/cdk/platform' ;
1
2
import { HarnessLoader } from '@angular/cdk-experimental/testing' ;
2
3
import { TestbedHarnessEnvironment } from '@angular/cdk-experimental/testing/testbed' ;
3
4
import { Component } from '@angular/core' ;
@@ -6,6 +7,7 @@ import {ReactiveFormsModule} from '@angular/forms';
6
7
import { MatRadioModule } from '@angular/material/radio' ;
7
8
import { MatRadioButtonHarness , MatRadioGroupHarness } from './radio-harness' ;
8
9
10
+ const platform = new Platform ( ) ;
9
11
let fixture : ComponentFixture < MultipleRadioButtonsHarnessTest > ;
10
12
let loader : HarnessLoader ;
11
13
let radioButtonHarness : typeof MatRadioButtonHarness ;
@@ -238,6 +240,13 @@ function runRadioButtonTests() {
238
240
} ) ;
239
241
240
242
it ( 'should not be able to check disabled radio-button' , async ( ) => {
243
+ if ( platform . FIREFOX ) {
244
+ // do run this test on firefox as click events on the label of the underlying
245
+ // input checkbox cause the value to be changed. Read more in the bug report:
246
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1540995
247
+ return ;
248
+ }
249
+
241
250
fixture . componentInstance . disableAll = true ;
242
251
fixture . detectChanges ( ) ;
243
252
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ ng_test_library(
73
73
"//src/cdk-experimental/testing" ,
74
74
"//src/cdk-experimental/testing/testbed" ,
75
75
"//src/cdk/bidi" ,
76
+ "//src/cdk/platform" ,
76
77
"//src/cdk/testing" ,
77
78
"//src/material/slide-toggle" ,
78
79
"@npm//@angular/forms" ,
Original file line number Diff line number Diff line change
1
+ import { Platform } from '@angular/cdk/platform' ;
1
2
import { HarnessLoader } from '@angular/cdk-experimental/testing' ;
2
3
import { TestbedHarnessEnvironment } from '@angular/cdk-experimental/testing/testbed' ;
3
4
import { Component } from '@angular/core' ;
@@ -8,7 +9,7 @@ import {MatSlideToggleModule as MatMdcSlideToggleModule} from '../index';
8
9
import { MatSlideToggleHarness } from './slide-toggle-harness' ;
9
10
import { MatSlideToggleHarness as MatMdcSlideToggleHarness } from './mdc-slide-toggle-harness' ;
10
11
11
-
12
+ const platform = new Platform ( ) ;
12
13
let fixture : ComponentFixture < SlideToggleHarnessTest > ;
13
14
let loader : HarnessLoader ;
14
15
let slideToggleHarness : typeof MatSlideToggleHarness ;
@@ -160,6 +161,13 @@ function runTests() {
160
161
} ) ;
161
162
162
163
it ( 'should not toggle disabled slide-toggle' , async ( ) => {
164
+ if ( platform . FIREFOX ) {
165
+ // do run this test on firefox as click events on the label of the underlying
166
+ // input checkbox cause the value to be changed. Read more in the bug report:
167
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1540995
168
+ return ;
169
+ }
170
+
163
171
const disabledToggle = await loader . getHarness ( slideToggleHarness . with ( { label : 'Second' } ) ) ;
164
172
expect ( await disabledToggle . isChecked ( ) ) . toBe ( false ) ;
165
173
await disabledToggle . toggle ( ) ;
You can’t perform that action at this time.
0 commit comments