-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rule-matches): depreacte window-is-top-matches for is-intiator-m…
…atches (#2531)
- Loading branch information
Showing
7 changed files
with
37 additions
and
5 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
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
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,5 @@ | ||
function isInitiatorMatches(node, virtualNode, context) { | ||
return context.initiator; | ||
} | ||
|
||
export default isInitiatorMatches; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
describe('is-initiator-matches', function() { | ||
'use strict'; | ||
|
||
var rule; | ||
|
||
beforeEach(function() { | ||
rule = axe._audit.rules.find(function(rule) { | ||
return rule.id === 'html-has-lang'; | ||
}); | ||
}); | ||
|
||
afterEach(function() { | ||
var fixture = document.getElementById('fixture'); | ||
fixture.innerHTML = ''; | ||
}); | ||
|
||
it('should return true if the context is the initiator', function() { | ||
assert.isTrue(rule.matches(null, null, { initiator: true })); | ||
}); | ||
|
||
it('should return false if the context is not the initiator', function() { | ||
assert.isFalse(rule.matches(null, null, { initiator: false })); | ||
}); | ||
}); |