From 9f655d20b5847732ad7760c79986363ea52089e9 Mon Sep 17 00:00:00 2001 From: Danyal Aytekin Date: Fri, 22 Mar 2024 04:58:30 +0000 Subject: [PATCH 1/2] Remove unnecessary ESLint override --- test/integration/cli-sitemap.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/cli-sitemap.test.js b/test/integration/cli-sitemap.test.js index 41fdfcb..a741e7a 100644 --- a/test/integration/cli-sitemap.test.js +++ b/test/integration/cli-sitemap.test.js @@ -1,4 +1,3 @@ -/* eslint max-len: 'off' */ 'use strict'; const assert = require('proclaim'); From 65511f3eaf6f981d96d5ec9ab9726c2d082cdcc9 Mon Sep 17 00:00:00 2001 From: Danyal Aytekin Date: Fri, 22 Mar 2024 05:03:20 +0000 Subject: [PATCH 2/2] Test the behaviour when URLs are present in both sitemap and config Co-Authored-By: Mikko Kotamies <2474092+mkotamies@users.noreply.github.com> --- test/integration/cli-sitemap.test.js | 29 +++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/test/integration/cli-sitemap.test.js b/test/integration/cli-sitemap.test.js index a741e7a..a056208 100644 --- a/test/integration/cli-sitemap.test.js +++ b/test/integration/cli-sitemap.test.js @@ -87,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(() => { @@ -98,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');