-
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.
fix: ignores axe.ping responses that do not contain axe=true
- Loading branch information
1 parent
96ab457
commit 26cb1fb
Showing
4 changed files
with
82 additions
and
1 deletion.
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
29 changes: 29 additions & 0 deletions
29
test/integration/full/frame-tested/frame-tested-echoes-postmessage.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,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>frame-tested echoes postMessage test</title> | ||
<meta charset="utf8" /> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="/node_modules/mocha/mocha.css" | ||
/> | ||
<script src="/node_modules/mocha/mocha.js"></script> | ||
<script src="/node_modules/chai/chai.js"></script> | ||
<script src="/axe.js"></script> | ||
<script> | ||
mocha.setup({ | ||
timeout: 10000, | ||
ui: 'bdd' | ||
}); | ||
var assert = chai.assert; | ||
</script> | ||
</head> | ||
<body> | ||
<iframe id="frame" src="frames/with-echo.html"></iframe> | ||
<div id="mocha"></div> | ||
<script src="/test/testutils.js"></script> | ||
<script src="frame-tested-echoes-postmessage.js"></script> | ||
<script src="/test/integration/adapter.js"></script> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
test/integration/full/frame-tested/frame-tested-echoes-postmessage.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,28 @@ | ||
describe('frame-tested-echoes-postmessage test', function() { | ||
'use strict'; | ||
|
||
var results; | ||
before(function(done) { | ||
axe.testUtils.awaitNestedLoad(function() { | ||
axe.run( | ||
{ | ||
runOnly: { type: 'rule', values: ['frame-tested'] }, | ||
checks: { | ||
'frame-tested': { options: { isViolation: true } } | ||
} | ||
}, | ||
function(err, r) { | ||
assert.isNull(err); | ||
results = r; | ||
done(); | ||
} | ||
); | ||
}); | ||
}); | ||
|
||
describe('result', function() { | ||
it('should not error', function() { | ||
assert.lengthOf(results.violations, 0); | ||
}); | ||
}); | ||
}); |
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,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Frame without axe-core</title> | ||
<meta charset="utf8" /> | ||
</head> | ||
<body> | ||
<h1>Frame without axe-core</h1> | ||
<script> | ||
window.addEventListener( | ||
'message', | ||
event => { | ||
window.top.postMessage(event.data); | ||
}, | ||
false | ||
); | ||
</script> | ||
</body> | ||
</html> |