mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed navigation tests
This commit is contained in:
parent
8a7d9001fd
commit
7d94975960
@ -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"))
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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 },
|
||||
|
Loading…
Reference in New Issue
Block a user