diff options
author | Sebastian <sebasjm@gmail.com> | 2022-06-24 12:32:37 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-06-24 12:32:37 -0300 |
commit | c239967813be8a65d649e4cadd4d531fd4e4990d (patch) | |
tree | 8ee55ed7c519f9d2059cafb2cd76360f3a5912c3 | |
parent | 50379a1d5b89822dd32618c32433cf12d1a1779e (diff) |
fix tests
-rw-r--r-- | packages/anastasis-webui/src/main.test.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/anastasis-webui/src/main.test.ts b/packages/anastasis-webui/src/main.test.ts index e65cca454..1a87e3857 100644 --- a/packages/anastasis-webui/src/main.test.ts +++ b/packages/anastasis-webui/src/main.test.ts @@ -24,8 +24,8 @@ import * as pages from "./pages/home/index.storiesNo.js"; setupI18n("en", { en: {} }); -function testThisStory(st: any): any { - describe(`render examples for ${(st as any).default.title}`, () => { +function testThisStory(key: string, st: any): any { + describe(`render examples for ${key}`, () => { Object.keys(st).forEach((k) => { const Component = (st as any)[k]; if (k === "default" || !Component) return; @@ -38,11 +38,12 @@ function testThisStory(st: any): any { } describe("render every storybook example", () => { - [pages].forEach(function testAll(st: any) { + Object.entries(pages).forEach(function testAll([key, value]) { + const st: any = value; if (Array.isArray(st.default)) { st.default.forEach(testAll); } else { - testThisStory(st); + testThisStory(key, st); } }); }); |