Skip to content

Commit

Permalink
pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Aug 22, 2024
1 parent dcc4130 commit 54e1d1a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"patch-package": "^8.0.0",
"prettier": "^3.0.3",
"revalidator": "^0.3.1",
"selenium-webdriver": "^4.7.1",
"selenium-webdriver": "^4.23.0",
"serve-handler": "^6.1.5",
"sinon": "^18.0.0",
"sri-toolbox": "^0.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "landmark-unique-pass_ tests",
"rule": "landmark-unique",
"violations": [["#header-notes"], ["#pass-aside-footnote1"]],
"violations": [["#header-notes"]],
"passes": [
["#pass-nav-toc"],
["#pass-nav-nav"],
Expand Down
27 changes: 21 additions & 6 deletions test/integration/rules/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,23 @@
if (!nodes) {
console.log(
JSON.stringify(results, null, 4),
' ---- ',
' a---- ',
JSON.stringify(test, null, 4)
);

assert(false, 'there are no ' + collection);
return;
}

const nodesBackup = [].concat(nodes);
// console.log(
// collection,
// selector,
// '====',
// JSON.stringify(nodes, null, 4),
// JSON.stringify(nodesBackup, null, 4),
// );

const matches = nodes.filter(node => {
for (let i = 0; i < selector.length; i++) {
if (node.target[i] !== selector[i]) {
Expand All @@ -86,8 +95,10 @@
if (matches.length === 0) {
console.log(
JSON.stringify(results, null, 4),
' ---- ',
JSON.stringify(test, null, 4)
' b---- ',
JSON.stringify(test, null, 4),
' b---- ',
JSON.stringify(nodesBackup, null, 4)
);

assert(false, 'Element not found');
Expand All @@ -96,8 +107,10 @@
} else {
console.log(
JSON.stringify(results, null, 4),
' ---- ',
JSON.stringify(test, null, 4)
' c---- ',
JSON.stringify(test, null, 4),
' c---- ',
JSON.stringify(nodesBackup, null, 4)
);

assert(
Expand All @@ -112,10 +125,12 @@
if (typeof nodes !== 'undefined') {
// console.log(
// JSON.stringify(results, null, 4),
// ' ---- ',
// ' d---- ',
// JSON.stringify(test, null, 4),
// ' +++++++++++ ',
// JSON.stringify(nodes, null, 4),
// ' d---- ',
// JSON.stringify(nodesBackup, null, 4)
// );
const targets = nodes.map(node => {
return node.target;
Expand Down
1 change: 1 addition & 0 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var testDirs = [
// npm run test:unit -- --browsers Chrome testFiles=test/integration/rules/link-in-text-block/link-in-text-block.json
// npm run test:unit -- --browsers ChromeHeadless testFiles=test/integration/rules/link-in-text-block/link-in-text-block.json

// npm run test:unit -- --browsers ChromeHeadless testFiles=test/integration/rules/landmark-unique/landmark-unique-pass_.json
'virtual-rules'
];
var testFiles = [];
Expand Down

0 comments on commit 54e1d1a

Please sign in to comment.