aboutsummaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/main.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/anastasis-webui/src/main.test.ts')
-rw-r--r--packages/anastasis-webui/src/main.test.ts9
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);
}
});
});