From c239967813be8a65d649e4cadd4d531fd4e4990d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 24 Jun 2022 12:32:37 -0300 Subject: fix tests --- packages/anastasis-webui/src/main.test.ts | 9 +++++---- 1 file 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); } }); }); -- cgit v1.2.3