From b852f2444a550d1c056c95a0a2b25b9bb44991b9 Mon Sep 17 00:00:00 2001 From: Gemma Leigh Date: Tue, 12 Sep 2017 15:07:09 +0100 Subject: [PATCH 1/3] Update paths to components --- tasks/gulp/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/gulp/test.js b/tasks/gulp/test.js index 30d7d8b4c9..27e33cc557 100644 --- a/tasks/gulp/test.js +++ b/tasks/gulp/test.js @@ -6,7 +6,7 @@ const axe = require('gulp-axe-webdriver') // Check HTML using Tenon ---------------- // --------------------------------------- gulp.task('html:tenon', function () { - return gulp.src('src/components/**/*.html', {read: false}) + return gulp.src('public/components/**/*.html', {read: false}) .pipe(gtenon({ config: 'config/tenon.json', snippet: true, // include errorSnippet in the console output @@ -25,7 +25,7 @@ gulp.task('html:axe', (done) => { let options = { browser: 'phantomjs', saveOutputIn: 'axeReport.json', - urls: ['src/components/**/*.html'], + urls: ['public/components/**/*.html'], // https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md a11yCheckOptions: { 'rules': { From 4598978753bf970f5e780a31447b09da4b66d99e Mon Sep 17 00:00:00 2001 From: Gemma Leigh Date: Tue, 12 Sep 2017 15:44:28 +0100 Subject: [PATCH 2/3] Add missing html to file upload component This is causing the gulp tenon plugin to fail. --- src/components/file-upload/file-upload.njk | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/file-upload/file-upload.njk b/src/components/file-upload/file-upload.njk index e69de29bb2..c8bc13153e 100644 --- a/src/components/file-upload/file-upload.njk +++ b/src/components/file-upload/file-upload.njk @@ -0,0 +1 @@ + From 8c45d1f21cd762f91b46e1f833c12a89e3e0c462 Mon Sep 17 00:00:00 2001 From: Gemma Leigh Date: Tue, 12 Sep 2017 15:45:15 +0100 Subject: [PATCH 3/3] Amend the test task to compile components first This must happen to copy the component html to /public before the tests are run. --- package.json | 2 +- packages/file-upload/file-upload.njk | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 packages/file-upload/file-upload.njk diff --git a/package.json b/package.json index 85bb71aeb0..6008389580 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "homepage": "https://github.com/alphagov/govuk-frontend#readme", "scripts": { "start": "gulp dev --destination 'public'", - "test": "standard && gulp test", + "test": "standard && gulp compile:components --destination 'public' && gulp test", "heroku": "gulp compile:components --destination 'public' && gulp copy-assets --destination 'public' && node app.js" }, "devDependencies": { diff --git a/packages/file-upload/file-upload.njk b/packages/file-upload/file-upload.njk new file mode 100644 index 0000000000..e69de29bb2