Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format HTML files with Prettier #1508

Merged
merged 3 commits into from
Apr 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 44 additions & 27 deletions doc/examples/mocha/test/test.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Mocha Test</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" type="text/css" charset="utf-8" />
</head>
<body>
<!-- Required for browser reporter -->
<div id="mocha"></div>
<head>
<meta charset="utf-8" />
<title>Example Mocha Test</title>
<link
rel="stylesheet"
href="../node_modules/mocha/mocha.css"
type="text/css"
charset="utf-8"
/>
</head>
<body>
<!-- Required for browser reporter -->
<div id="mocha"></div>

<script src="../node_modules/mocha/mocha.js" type="text/javascript" charset="utf-8"></script>
<script src="../node_modules/chai/chai.js" type="text/javascript" charset="utf-8"></script>
<script src="../node_modules/axe-core/axe.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
mocha.setup('bdd');
var expect = chai.expect;
</script>
<script
src="../node_modules/mocha/mocha.js"
type="text/javascript"
charset="utf-8"
></script>
<script
src="../node_modules/chai/chai.js"
type="text/javascript"
charset="utf-8"
></script>
<script
src="../node_modules/axe-core/axe.min.js"
type="text/javascript"
charset="utf-8"
></script>
<script type="text/javascript" charset="utf-8">
mocha.setup('bdd');
var expect = chai.expect;
</script>

<!-- Include axe -->
<!-- Include axe -->

<!-- Spec files -->
<script src="a11y.js" type="text/javascript" charset="utf-8"></script>
<div id="working">
<label for="labelfld">Label for this text field.</label>
<input type="text" id="labelfld">
</div>
<div id="broken">
<p>Label for this text field.</p>
<input type="text" id="nolabelfld">
</div>
</body>
<!-- Spec files -->
<script src="a11y.js" type="text/javascript" charset="utf-8"></script>
<div id="working">
<label for="labelfld">Label for this text field.</label>
<input type="text" id="labelfld" />
</div>
<div id="broken">
<p>Label for this text field.</p>
<input type="text" id="nolabelfld" />
</div>
</body>
</html>
50 changes: 26 additions & 24 deletions doc/examples/qunit/test/test.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Basic Test Suite</title>
<!-- Load local QUnit. -->
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" media="screen">
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<!-- Load local lib and tests. -->
<script src="../node_modules/axe-core/axe.min.js"></script>
<script src="a11y.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">
</div>
<div id="working">
<label for="labelfld">Label for this text field.</label>
<input type="text" id="labelfld">
</div>
<div id="broken">
<p>Label for this text field.</p>
<input type="text" id="nolabelfld">
</div>

</body>
<head>
<meta charset="utf-8" />
<title>Basic Test Suite</title>
<!-- Load local QUnit. -->
<link
rel="stylesheet"
href="../node_modules/qunitjs/qunit/qunit.css"
media="screen"
/>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<!-- Load local lib and tests. -->
<script src="../node_modules/axe-core/axe.min.js"></script>
<script src="a11y.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<div id="working">
<label for="labelfld">Label for this text field.</label>
<input type="text" id="labelfld" />
</div>
<div id="broken">
<p>Label for this text field.</p>
<input type="text" id="nolabelfld" />
</div>
</body>
</html>
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"rule-gen": "node build/rule-generator",
"next-release": "standard-version --scripts.prebump=./build/next-version.js --skip.commit=true --skip.tag=true",
"sri-update": "grunt build && node build/sri-update && git add sri-history.json",
"fmt": "prettier --write *.{json,md,js} **/*.ts './{build,doc,lib,test}/**/*.{json,md,js,ts}'"
"fmt": "prettier --write *.{json,md,js} **/*.ts './{build,doc,lib,test}/**/*.{json,md,js,ts,html}'"
},
"devDependencies": {
"@babel/core": "^7.3.4",
Expand Down Expand Up @@ -115,7 +115,7 @@
"minami": "^1.2.3",
"mkdirp": "^0.5.1",
"mocha": "^6.1.2",
"prettier": "^1.14.0",
"prettier": "^1.17.0",
"retire": "^2.0.1",
"revalidator": "~0.3.1",
"selenium-webdriver": "~3.6.0",
Expand All @@ -126,7 +126,7 @@
},
"dependencies": {},
"lint-staged": {
"*.{md,json,ts}": [
"*.{md,json,ts,html}": [
"prettier --write",
"git add"
],
Expand Down
6 changes: 4 additions & 2 deletions test/core/public/run-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ describe('runRules', function() {
fixture.appendChild(frame);
});

// NOTE: this test depends on the whitespace in /test/mock/frames/context.html. If the whitespace changes in that file, this test needs to be updated to reflect that change.
it('should properly calculate context and return results from matching frames', function(done) {
axe._load({
rules: [
Expand Down Expand Up @@ -251,7 +252,8 @@ describe('runRules', function() {
node: {
selector: ['#context-test', '#foo'],
xpath: ["/iframe[@id='context-test']", "/div[@id='foo']"],
source: '<div id="foo">\n <div id="bar"></div>\n </div>'
source:
'<div id="foo">\n\t\t\t<div id="bar"></div>\n\t\t</div>'
},
any: [
{
Expand All @@ -265,7 +267,7 @@ describe('runRules', function() {
"/div[@id='foo']"
],
source:
'<div id="foo">\n <div id="bar"></div>\n </div>'
'<div id="foo">\n\t\t\t<div id="bar"></div>\n\t\t</div>'
}
]
}
Expand Down
50 changes: 27 additions & 23 deletions test/integration/full/aria-hidden-body/fail.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML+ARIA 1.0//EN" "http://www.w3.org/WAI/ARIA/schemata/html4-aria-1.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+ARIA 1.0//EN" "http://www.w3.org/WAI/ARIA/schemata/html4-aria-1.dtd">
<html lang="en">
<head>
<title>aria-hidden on body Test</title>
<head>
<title>aria-hidden on body Test</title>

<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>
<script src="/test/integration/no-ui-reporter.js"></script>
</head>
<body aria-hidden="true">
<h2>Some title.</h2>
<a href="http://www.deque.com">Deque</a>
<div id="mocha"></div>
<script src="fail.js"></script>
<script src="/test/integration/adapter.js"></script>
</body>
<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>
<script src="/test/integration/no-ui-reporter.js"></script>
</head>
<body aria-hidden="true">
<h2>Some title.</h2>
<a href="http://www.deque.com">Deque</a>
<div id="mocha"></div>
<script src="fail.js"></script>
<script src="/test/integration/adapter.js"></script>
</body>
</html>
50 changes: 27 additions & 23 deletions test/integration/full/aria-hidden-body/pass.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML+ARIA 1.0//EN" "http://www.w3.org/WAI/ARIA/schemata/html4-aria-1.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+ARIA 1.0//EN" "http://www.w3.org/WAI/ARIA/schemata/html4-aria-1.dtd">
<html lang="en">
<head>
<title>aria-hidden on body Test</title>
<head>
<title>aria-hidden on body Test</title>

<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>
<script src="/test/integration/no-ui-reporter.js"></script>
</head>
<body aria-hidden="false">
<h2>Some title.</h2>
<a href="http://www.deque.com">Deque</a>
<div id="mocha"></div>
<script src="pass.js"></script>
<script src="/test/integration/adapter.js"></script>
</body>
<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>
<script src="/test/integration/no-ui-reporter.js"></script>
</head>
<body aria-hidden="false">
<h2>Some title.</h2>
<a href="http://www.deque.com">Deque</a>
<div id="mocha"></div>
<script src="pass.js"></script>
<script src="/test/integration/adapter.js"></script>
</body>
</html>
53 changes: 28 additions & 25 deletions test/integration/full/async/async.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML+ARIA 1.0//EN" "http://www.w3.org/WAI/ARIA/schemata/html4-aria-1.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+ARIA 1.0//EN" "http://www.w3.org/WAI/ARIA/schemata/html4-aria-1.dtd">
<html lang="en">
<head>
<title>Async Test</title>
<head>
<title>Async Test</title>

<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>
<script src="/test/integration/no-ui-reporter.js"></script>
</head>
<body>
<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>
<script src="/test/integration/no-ui-reporter.js"></script>
</head>
<body>
<div class="async" data-out="true" id="pass"></div>
<div class="async" data-out="false" id="violation"></div>
<div class="async" data-out="undefined" id="incomplete"></div>

<div class="async" data-out="true" id="pass"></div>
<div class="async" data-out="false" id="violation"></div>
<div class="async" data-out="undefined" id="incomplete"></div>

<div id="mocha"></div>
<script src="async.js"></script>
<script src="/test/integration/adapter.js"></script>
</body>
<div id="mocha"></div>
<script src="async.js"></script>
<script src="/test/integration/adapter.js"></script>
</body>
</html>
Loading