forked from DevExpress/testcafe
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent chrome from changing checkbox checked state when disabled che…
…ckbox label is clicked(closes DevExpress#6949)
- Loading branch information
1 parent
36c3a8f
commit c2298f9
Showing
4 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
test/functional/fixtures/regression/gh-6949/pages/with-disabled-checkbox.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
<div class="checkbox"> | ||
<input id="checkbox" disabled type="checkbox"> | ||
<label for="checkbox" id="checkbox-label"> | ||
I have read and accept | ||
</label> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
test/functional/fixtures/regression/gh-6949/testcafe-fixtures/with-disabled-checkbox.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture`Getting Started` | ||
.page`http://localhost:3000/fixtures/regression/gh-6949/pages/with-disabled-checkbox.html`; | ||
|
||
test('Click disabled checkbox label', async t => { | ||
const label = Selector('#checkbox-label'); | ||
const checkBox = Selector('#checkbox'); | ||
|
||
await t.click(label); | ||
await t.expect(checkBox.checked).eql(false); | ||
}); |