diff --git a/Gulpfile.babel.js b/Gulpfile.babel.js index 5aa515544..3a56645f0 100755 --- a/Gulpfile.babel.js +++ b/Gulpfile.babel.js @@ -45,7 +45,7 @@ const config = { } } -const args = yargs +let args = yargs .default("clean", false) /* Clean before build */ .default("karma", true) /* Karma watchdog */ .default("lint", true) /* Lint sources */ @@ -55,6 +55,12 @@ const args = yargs .default("sourcemaps", false) /* Create sourcemaps */ .argv +/* Only use the last value seen, so overrides are possible */ +args = Object.keys(args).reduce((result, arg) => { + result[arg] = [].concat(args[arg]).pop() + return result +}, {}) + /* ---------------------------------------------------------------------------- * Overrides and helpers * ------------------------------------------------------------------------- */ @@ -278,10 +284,11 @@ gulp.task("mkdocs:serve", /* * Generate visual tests */ -gulp.task("tests:visual:generate", (args.clean ? [ - // "assets:build", // TODO: only commented out for dev - // "views:build", +gulp.task("tests:visual:generate", [ "tests:visual:clean" +].concat(args.clean ? [ + "assets:build", + "views:build" ] : []), load("tests/visual/generate")) diff --git a/tests/visual/helpers/spec.js b/tests/visual/helpers/spec.js index e7be27793..760ca5ba4 100644 --- a/tests/visual/helpers/spec.js +++ b/tests/visual/helpers/spec.js @@ -75,8 +75,10 @@ const generate = (dirname, components) => { /* Create suite */ gemini.suite(name, suite => { - if (component.url) - suite.setUrl(path.join(base, component.url, "_")) + if (component.dir || component.url) + suite.setUrl(path.join( + base, component.dir ? component.dir : "", + "_", component.url ? component.url : "")) /* The capture selector is assumed to exist */ suite.setCaptureElements(component.capture) diff --git a/tests/visual/suites/layout/nav/suite.js b/tests/visual/suites/layout/nav/suite.js index bd0583e72..02764783c 100644 --- a/tests/visual/suites/layout/nav/suite.js +++ b/tests/visual/suites/layout/nav/suite.js @@ -60,7 +60,7 @@ spec.generate(__dirname, { /* Long list title with ellipsis */ "~overflow": { - "url": "/_overflow", + "dir": "_overflow", "capture": ".md-nav--primary .md-nav__title", "states": [ { "name": "", "wait": 250, "exec": open } @@ -152,7 +152,7 @@ spec.generate(__dirname, { /* Active link */ "md-nav__link--active": { - "capture": ".md-nav--primary .md-nav__link--active", + "capture": ".md-nav--primary .md-nav__item .md-nav__link--active", "states": [ { "name": "", "wait": 250, "exec": open }, { "name": ":focus", "wait": 250, "exec": open },