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

[WIP] Clarify behaviour when supplied URLs in both sitemap and config #236

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
30 changes: 28 additions & 2 deletions test/integration/cli-sitemap.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint max-len: 'off' */
'use strict';

const assert = require('proclaim');
Expand Down Expand Up @@ -88,6 +87,33 @@ describe('pa11y-ci (with a sitemap and sitemap-exclude)', () => {

});

describe('pa11y-ci (with URLs defined in both sitemap and config)', () => {

before(() => {
return global.cliCall([
'--sitemap',
'http://localhost:8090/sitemap.xml',
'--config',
'passing-multiple'
]);
});

it('loads the URLs listed by the sitemap', () => {
assert.include(global.lastResult.output, 'http://localhost:8090/passing-1');
assert.include(global.lastResult.output, 'http://localhost:8090/failing-1');
assert.include(global.lastResult.output, 'http://localhost:8090/excluded');
});

it('loads the URLs listed by the config', () => {
assert.include(global.lastResult.output, 'http://localhost:8090/passing-2');
});

it('will not remove URLs duplicated across both sitemap and config', () => {
assert.lengthEquals(global.lastResult.output.match(/passing-1/g), 2);
});

});

describe('pa11y-ci (with a sitemap being sitemapindex)', () => {

before(() => {
Expand All @@ -99,7 +125,7 @@ describe('pa11y-ci (with a sitemap being sitemapindex)', () => {
]);
});

it('loads the expected urls from multiple sitemaps', () => {
it('loads the expected URLs from multiple sitemaps', () => {
assert.include(global.lastResult.output, 'http://localhost:8090/passing-1');
assert.include(global.lastResult.output, 'http://localhost:8090/failing-1');
assert.include(global.lastResult.output, 'http://localhost:8090/excluded');
Expand Down
Loading