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() {
112112 // Older versions of Edge have a bug where `disabled` buttons are still clickable if
113113 // they contain child elements. We skip this check on Edge.
114114 // See https://stackoverflow.com/questions/32377026/disabled-button-is-clickable-on-edge-browser
115- if ( platform . EDGE ) {
115+ if ( platform . EDGE || platform . FIREFOX ) {
116116 return ;
117117 }
118118
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ ng_test_library(
7373 ":mdc-checkbox" ,
7474 "//src/cdk-experimental/testing" ,
7575 "//src/cdk-experimental/testing/testbed" ,
76+ "//src/cdk/platform" ,
7677 "//src/cdk/testing" ,
7778 "//src/material/checkbox" ,
7879 "@npm//@angular/forms" ,
Original file line number Diff line number Diff line change 1+ import { Platform } from '@angular/cdk/platform' ;
12import { HarnessLoader } from '@angular/cdk-experimental/testing' ;
23import { TestbedHarnessEnvironment } from '@angular/cdk-experimental/testing/testbed' ;
34import { Component } from '@angular/core' ;
@@ -8,6 +9,7 @@ import {MatCheckboxModule as MatMdcCheckboxModule} from '../index';
89import { MatCheckboxHarness } from './checkbox-harness' ;
910import { MatCheckboxHarness as MatMdcCheckboxHarness } from './mdc-checkbox-harness' ;
1011
12+ const platform = new Platform ( ) ;
1113let fixture : ComponentFixture < CheckboxHarnessTest > ;
1214let loader : HarnessLoader ;
1315let checkboxHarness : typeof MatCheckboxHarness ;
@@ -178,6 +180,12 @@ function runTests() {
178180 } ) ;
179181
180182 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+
181189 const disabledCheckbox = await loader . getHarness ( checkboxHarness . with ( { label : 'Second' } ) ) ;
182190 expect ( await disabledCheckbox . isChecked ( ) ) . toBe ( false ) ;
183191 await disabledCheckbox . toggle ( ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ ng_test_library(
2121 ":harness" ,
2222 "//src/cdk-experimental/testing" ,
2323 "//src/cdk-experimental/testing/testbed" ,
24+ "//src/cdk/platform" ,
2425 "//src/material/radio" ,
2526 "@npm//@angular/forms" ,
2627 ],
Original file line number Diff line number Diff line change 1+ import { Platform } from '@angular/cdk/platform' ;
12import { HarnessLoader } from '@angular/cdk-experimental/testing' ;
23import { TestbedHarnessEnvironment } from '@angular/cdk-experimental/testing/testbed' ;
34import { Component } from '@angular/core' ;
@@ -6,6 +7,7 @@ import {ReactiveFormsModule} from '@angular/forms';
67import { MatRadioModule } from '@angular/material/radio' ;
78import { MatRadioButtonHarness , MatRadioGroupHarness } from './radio-harness' ;
89
10+ const platform = new Platform ( ) ;
911let fixture : ComponentFixture < MultipleRadioButtonsHarnessTest > ;
1012let loader : HarnessLoader ;
1113let radioButtonHarness : typeof MatRadioButtonHarness ;
@@ -238,6 +240,13 @@ function runRadioButtonTests() {
238240 } ) ;
239241
240242 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+
241250 fixture . componentInstance . disableAll = true ;
242251 fixture . detectChanges ( ) ;
243252
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ ng_test_library(
7373 "//src/cdk-experimental/testing" ,
7474 "//src/cdk-experimental/testing/testbed" ,
7575 "//src/cdk/bidi" ,
76+ "//src/cdk/platform" ,
7677 "//src/cdk/testing" ,
7778 "//src/material/slide-toggle" ,
7879 "@npm//@angular/forms" ,
Original file line number Diff line number Diff line change 1+ import { Platform } from '@angular/cdk/platform' ;
12import { HarnessLoader } from '@angular/cdk-experimental/testing' ;
23import { TestbedHarnessEnvironment } from '@angular/cdk-experimental/testing/testbed' ;
34import { Component } from '@angular/core' ;
@@ -8,7 +9,7 @@ import {MatSlideToggleModule as MatMdcSlideToggleModule} from '../index';
89import { MatSlideToggleHarness } from './slide-toggle-harness' ;
910import { MatSlideToggleHarness as MatMdcSlideToggleHarness } from './mdc-slide-toggle-harness' ;
1011
11-
12+ const platform = new Platform ( ) ;
1213let fixture : ComponentFixture < SlideToggleHarnessTest > ;
1314let loader : HarnessLoader ;
1415let slideToggleHarness : typeof MatSlideToggleHarness ;
@@ -160,6 +161,13 @@ function runTests() {
160161 } ) ;
161162
162163 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+
163171 const disabledToggle = await loader . getHarness ( slideToggleHarness . with ( { label : 'Second' } ) ) ;
164172 expect ( await disabledToggle . isChecked ( ) ) . toBe ( false ) ;
165173 await disabledToggle . toggle ( ) ;
You can’t perform that action at this time.
0 commit comments