-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply "Create traffic sign component (#848)"
This reverts commit 617f0fd.
- Loading branch information
1 parent
8c2fa96
commit a30890d
Showing
187 changed files
with
14,404 additions
and
41 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
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
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 +1,2 @@ | ||
export { default } from "./Figure"; | ||
export type { FigureProps } from "./Figure.types"; |
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,141 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
/** | ||
* Test to check that the default version of the component renders correct | ||
*/ | ||
test("should render default highway sign", async ({ page }) => { | ||
await page.goto( | ||
"http://localhost:6006/?path=/story/roadview-trafficsign--default" | ||
); | ||
// set imageLoaded to false | ||
await page.frame("storybook-preview-iframe")?.evaluate(() => { | ||
(window as any).imageLoaded = "false"; | ||
}); | ||
// wait till component loads and sets imageLoaded to `true` | ||
await page | ||
.frame("storybook-preview-iframe") | ||
?.waitForFunction(() => (window as any).imageLoaded === true); | ||
await expect( | ||
page | ||
.frameLocator('iframe[title="storybook-preview-iframe"]') | ||
.locator("canvas") | ||
).toHaveScreenshot("default.png", { maxDiffPixels: 100 }); | ||
}); | ||
|
||
/** | ||
* Test to check that the rotated version of the component renders correct | ||
*/ | ||
test("should render rotated highway sign", async ({ page }) => { | ||
await page.goto( | ||
"http://localhost:6006/?path=/story/roadview-trafficsign--rotated" | ||
); | ||
|
||
// set imageLoaded to false | ||
await page.frame("storybook-preview-iframe")?.evaluate(() => { | ||
(window as any).imageLoaded = "false"; | ||
}); | ||
// wait till component loads and sets imageLoaded to `true` | ||
await page | ||
.frame("storybook-preview-iframe") | ||
?.waitForFunction(() => (window as any).imageLoaded === true); | ||
|
||
await expect( | ||
page | ||
.frameLocator('iframe[title="storybook-preview-iframe"]') | ||
.locator("canvas") | ||
).toHaveScreenshot("rotated.png", { maxDiffPixels: 100 }); | ||
}); | ||
|
||
/** | ||
* Test to check that the with value version of the component renders correct | ||
*/ | ||
test("should render speed limit sign with value", async ({ page }) => { | ||
await page.goto( | ||
"http://localhost:6006/?path=/story/roadview-trafficsign--with-value" | ||
); | ||
|
||
// set imageLoaded to false | ||
await page.frame("storybook-preview-iframe")?.evaluate(() => { | ||
(window as any).imageLoaded = "false"; | ||
}); | ||
// wait till component loads and sets imageLoaded to `true` | ||
await page | ||
.frame("storybook-preview-iframe") | ||
?.waitForFunction(() => (window as any).imageLoaded === true); | ||
|
||
await expect( | ||
page | ||
.frameLocator('iframe[title="storybook-preview-iframe"]') | ||
.locator("canvas") | ||
).toHaveScreenshot("with-value.png", { maxDiffPixels: 100 }); | ||
}); | ||
|
||
/** | ||
* Test to check that the speed limit can be changed | ||
*/ | ||
test("should change the speed limit value of the string", async ({ page }) => { | ||
await page.goto( | ||
"http://localhost:6006/?path=/story/roadview-trafficsign--with-value" | ||
); | ||
|
||
// set imageLoaded to false | ||
await page.frame("storybook-preview-iframe")?.evaluate(() => { | ||
(window as any).imageLoaded = "false"; | ||
}); | ||
await page.locator("#control-type").selectOption("speedLimit50"); | ||
// wait till component loads and sets imageLoaded to `true` | ||
await page | ||
.frame("storybook-preview-iframe") | ||
?.waitForFunction(() => (window as any).imageLoaded === true); | ||
|
||
await expect( | ||
page | ||
.frameLocator('iframe[title="storybook-preview-iframe"]') | ||
.locator("canvas") | ||
).toHaveScreenshot("speedLimit50.png", { maxDiffPixels: 100 }); | ||
}); | ||
|
||
/** | ||
* Test to check that the sized version of the component renders correct | ||
*/ | ||
test("should render sized version of the highway sign", async ({ page }) => { | ||
await page.goto( | ||
"http://localhost:6006/?path=/story/roadview-trafficsign--sized" | ||
); | ||
// set imageLoaded to false | ||
await page.frame("storybook-preview-iframe")?.evaluate(() => { | ||
(window as any).imageLoaded = "false"; | ||
}); | ||
// wait till component loads and sets imageLoaded to `true` | ||
await page | ||
.frame("storybook-preview-iframe") | ||
?.waitForFunction(() => (window as any).imageLoaded === true); | ||
await expect( | ||
page | ||
.frameLocator('iframe[title="storybook-preview-iframe"]') | ||
.locator("canvas") | ||
).toHaveScreenshot("sized.png", { maxDiffPixels: 100 }); | ||
}); | ||
|
||
/** | ||
* Test to check that the scaled version of the component renders correct | ||
*/ | ||
test("should render scaled version of the highway sign", async ({ page }) => { | ||
await page.goto( | ||
"http://localhost:6006/?path=/story/roadview-trafficsign--scaled" | ||
); | ||
|
||
// set imageLoaded to false | ||
await page.frame("storybook-preview-iframe")?.evaluate(() => { | ||
(window as any).imageLoaded = "false"; | ||
}); | ||
// wait till component loads and sets imageLoaded to `true` | ||
await page | ||
.frame("storybook-preview-iframe") | ||
?.waitForFunction(() => (window as any).imageLoaded === true); | ||
await expect( | ||
page | ||
.frameLocator('iframe[title="storybook-preview-iframe"]') | ||
.locator("canvas") | ||
).toHaveScreenshot("scaled.png", { maxDiffPixels: 100 }); | ||
}); |
Binary file added
BIN
+1.29 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/default-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.21 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/default-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.25 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/default-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.29 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/rotated-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.99 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/rotated-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.26 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/rotated-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.04 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/scaled-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.13 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/scaled-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.53 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/scaled-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.23 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/sized-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.71 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/sized-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.05 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/sized-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.41 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/speedLimit50-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.83 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/speedLimit50-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.83 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/speedLimit50-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.42 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/with-value-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.86 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/with-value-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.86 KB
src/TrafficSign/TrafficSign.spec.tsx-snapshots/with-value-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.