pwa-helpers
Version:
Small helper methods or mixins to help you build web apps.
58 lines (52 loc) • 1.9 kB
HTML
<!--
@license
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>axe-report</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
</head>
<body>
<test-fixture id="basic">
<template>
<div>
<button id="good">Contains text</button>
<button id="bad"></button>
</div>
</template>
</test-fixture>
<script type="module">
import '@polymer/test-fixture';
import 'axe-core/axe.min.js';
import { axeReport } from '../axe-report.js';
suite('axe-report tests', () => {
let good, bad;
setup(() => {
const div = fixture('basic');
good = div.querySelector('button#good');
bad = div.querySelector('button#bad');
});
test('good button should pass', () => {
return axeReport(good);
});
test('bad button should fail', async () => {
let error;
await axeReport(bad).catch((e) => error = e);
assert.isDefined(error);
});
});
</script>
</body>
</html>