-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from rackerlabs/jest-spike-squashed
spike(ava): Switch from mocha/chai
- Loading branch information
Showing
17 changed files
with
2,712 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.github-token | ||
bin/*.js | ||
bin/visreg.config.ts | ||
built/ | ||
index.js | ||
screenshots | ||
!built/functional/*.js.snap | ||
!built/functional/*.js.md | ||
screenshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Snapshot report for `built/functional/hx-reveal.js` | ||
|
||
The actual snapshot is saved in `hx-reveal.js.snap`. | ||
|
||
Generated by [AVA](https://ava.li). | ||
|
||
## should not be open | ||
|
||
> Snapshot 1 | ||
`<hx-reveal>␊ | ||
<span slot="summary">Click me to show content</span>␊ | ||
<p>You can't see me.</p>␊ | ||
</hx-reveal>` | ||
|
||
## should open | ||
|
||
> Snapshot 1 | ||
`<hx-reveal open="">␊ | ||
<span slot="summary">Click me to show content</span>␊ | ||
<p>You can't see me.</p>␊ | ||
</hx-reveal>` |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {$, snap, Snappit, IConfig} from "snappit-visual-regression"; | ||
import {WebDriver, WebElementPromise} from "selenium-webdriver"; | ||
|
||
import {test, TestContext} from "ava"; | ||
|
||
const baseUrl = "http://localhost:3000/helix-ui"; | ||
const snapshot = async (t: TestContext, element: WebElementPromise) => { | ||
t.snapshot(await element.getAttribute("outerHTML")); | ||
}; | ||
|
||
let snappit: Snappit; | ||
let driver: WebDriver; | ||
let reveal: WebElementPromise; | ||
|
||
test.before(async () => { | ||
const config: IConfig = { | ||
browser: "chrome", | ||
serverUrl: "http://localhost:4444/wd/hub", | ||
}; | ||
|
||
snappit = new Snappit(config); | ||
driver = await snappit.start(); | ||
await driver.get(`${baseUrl}/components/reveal`); | ||
reveal = $(".demo hx-reveal"); | ||
}); | ||
|
||
test("should not be open", async t => { | ||
t.is(await reveal.getAttribute("open"), null); | ||
await snapshot(t, reveal); | ||
}); | ||
|
||
test("should open", async t => { | ||
await reveal.click(); | ||
t.is(await reveal.getAttribute("open"), "true"); | ||
await snapshot(t, reveal); | ||
}); | ||
|
||
test.after.always(async () => { | ||
await snappit.stop(); | ||
}); |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as visreg from "./visreg"; | ||
|
||
visreg.suite("chrome"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as visreg from "./visreg"; | ||
|
||
visreg.suite("firefox"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {$, snap, Snappit, IConfig} from "snappit-visual-regression"; | ||
|
||
import * as util from "../common/util"; | ||
import {test} from "ava"; | ||
|
||
export function suite(browserName: string) { | ||
let snappit: Snappit; | ||
let driver: any; | ||
|
||
test.before(async () => { | ||
const config: IConfig = { | ||
browser: browserName, | ||
screenshotsDir: "visreg/screenshots", | ||
logException: [ | ||
"MISMATCH", | ||
"NO_BASELINE", | ||
"SIZE_DIFFERENCE", | ||
], | ||
threshold: 0.1, | ||
useDirect: true, | ||
useGeckoDriver: (browserName === "firefox"), | ||
}; | ||
|
||
snappit = new Snappit(config); | ||
driver = await snappit.start(); | ||
await util.setViewportSize(driver, { width: 1366, height: 768 }); | ||
driver.get("http://localhost:3000/"); | ||
}); | ||
|
||
test("nav", async () => { | ||
await snap("{browserName}/nav", $(util.selectors.nav)); | ||
}); | ||
|
||
test("guides", async () => { | ||
await util.$x(driver, "//nav/hx-reveal//header", "Guides").click(); | ||
await snap("{browserName}/nav/guides", $(util.selectors.nav)); | ||
}); | ||
|
||
test("components", async () => { | ||
await util.$x(driver, "//nav/hx-reveal//header", "Components").click(); | ||
await snap("{browserName}/nav/componenets", $(util.selectors.nav)); | ||
}); | ||
|
||
test.after.always(async () => { | ||
await snappit.stop(); | ||
}); | ||
} |
Oops, something went wrong.