Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed incorrect check visibility of an SVG element in a hidden e…
…lement (#6799) * test: added test [Regression](GH-3495) - Visibility check should incorporate visibility of parent SVG element(s) * type: made optional second and third params of the method findParent * fix: added check visibility for the parent of the svg element * test: fixed test
- Loading branch information
Showing
5 changed files
with
53 additions
and
3 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
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
14 changes: 14 additions & 0 deletions
14
test/functional/fixtures/regression/gh-3495/pages/index.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,14 @@ | ||
<html> | ||
<body> | ||
<div> | ||
<span data-test="checkbox"> | ||
<div id="parent" style="display:none"> | ||
<svg id="child" fill="grey" stroke="red" viewBox="0 0 300 100"> | ||
<circle cx="50" cy="50" r="40"/> | ||
<circle cx="150" cy="50" r="4"/> | ||
</svg> | ||
</div> | ||
</span> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
describe('[Regression](GH-3495) - Visibility check should incorporate visibility of parent SVG element(s)', function () { | ||
it('Check visibility parent', function () { | ||
return runTests('testcafe-fixtures/index.js', 'Paren shouldn\'t be visible'); | ||
}); | ||
it('Check visibility child', function () { | ||
return runTests('testcafe-fixtures/index.js', 'Child shouldn\'t be visible'); | ||
}); | ||
}); | ||
|
||
|
20 changes: 20 additions & 0 deletions
20
test/functional/fixtures/regression/gh-3495/testcafe-fixtures/index.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,20 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture`Fixture` | ||
.page('../pages/index.html'); | ||
|
||
test('Paren shouldn\'t be visible', async t => { | ||
const svg = Selector('#parent'); | ||
|
||
await t | ||
.expect(svg.exists).ok() | ||
.expect(svg.visible).notOk(); | ||
}); | ||
|
||
test('Child shouldn\'t be visible', async t => { | ||
const svg = Selector('#child'); | ||
|
||
await t | ||
.expect(svg.exists).ok() | ||
.expect(svg.visible).notOk(); | ||
}); |