Fixed navigation tests

This commit is contained in:
squidfunk 2017-02-02 00:40:36 +01:00
parent 8a7d9001fd
commit 7d94975960
3 changed files with 17 additions and 8 deletions

View File

@ -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"))

View File

@ -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)

View File

@ -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 },