Skip to content

Commit

Permalink
update based on reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeyyy committed Apr 23, 2019
1 parent c3e0408 commit 8ab5d1a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test/core/utils/get-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ describe('axe.utils.getScroll', function() {
var actual = axe.utils.getScroll(target.actualNode);
assert.isDefined(actual);
assert.hasAllKeys(actual, ['elm', 'top', 'left']);
assert.equal(actual.top, 0);
assert.equal(actual.left, 0);
});

it('returns scroll offset when element overflow is auto', function() {
Expand All @@ -57,6 +59,8 @@ describe('axe.utils.getScroll', function() {
var actual = axe.utils.getScroll(target.actualNode);
assert.isDefined(actual);
assert.hasAllKeys(actual, ['elm', 'top', 'left']);
assert.equal(actual.top, 0);
assert.equal(actual.left, 0);
});

it('returns undefined when element overflow is visible', function() {
Expand All @@ -74,6 +78,8 @@ describe('axe.utils.getScroll', function() {
var actual = axe.utils.getScroll(target.actualNode);
assert.isDefined(actual);
assert.hasAllKeys(actual, ['elm', 'top', 'left']);
assert.equal(actual.top, 0);
assert.equal(actual.left, 0);
});

describe('shadowDOM - axe.utils.getScroll', function() {
Expand Down Expand Up @@ -110,6 +116,8 @@ describe('axe.utils.getScroll', function() {
var actual = axe.utils.getScroll(target.actualNode);
assert.isDefined(actual);
assert.hasAllKeys(actual, ['elm', 'top', 'left']);
assert.equal(actual.top, 0);
assert.equal(actual.left, 0);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"description": "scrollable-region-focusable tests",
"rule": "scrollable-region-focusable",
"violations": [["#fail1"], ["#fail2"], ["#fail3"]],
"passes": [["#fixture"], ["#pass1"], ["#pass2"], ["#pass3"]]
"passes": [["#pass1"], ["#pass2"], ["#pass3"]]
}
12 changes: 12 additions & 0 deletions test/rule-matches/scrollable-region-focusable-matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ describe('scrollable-region-focusable-matches', function() {
assert.isFalse(actual);
});

it('returns false when element has no visible children', function() {
var target = queryFixture(
'<div id="target" style="height: 200px; width: 200px;">' +
'<div style="display:none; height: 2000px; width: 100px;">' +
'<p> Content </p>' +
'</div>' +
'</div>'
);
var actual = rule.matches(target.actualNode, target);
assert.isFalse(actual);
});

it('returns false when element does not overflow', function() {
var target = queryFixture(
'<div id="target" style="height: 200px; width: 200px; overflow: auto;">' +
Expand Down

0 comments on commit 8ab5d1a

Please sign in to comment.