fix: address Storybook review findings
This commit is contained in:
parent
d95f064189
commit
17c9d24e31
8 changed files with 121 additions and 20 deletions
|
|
@ -3,6 +3,7 @@ import { join } from "node:path";
|
|||
import { describe, expect, test } from "vitest";
|
||||
|
||||
const root = process.cwd();
|
||||
const componentsDir = join(root, "src/lib/ui/components");
|
||||
const storiesDir = join(root, "src/lib/ui/stories");
|
||||
|
||||
const requiredStoryFiles = [
|
||||
|
|
@ -57,6 +58,16 @@ describe("Storybook inventory", () => {
|
|||
}
|
||||
});
|
||||
|
||||
test("keeps component and story files paired as the UI inventory changes", () => {
|
||||
const componentStoryFiles = readdirSync(componentsDir)
|
||||
.filter((filename) => filename.endsWith(".svelte"))
|
||||
.map((filename) => filename.replace(".svelte", ".stories.svelte"));
|
||||
|
||||
for (const filename of componentStoryFiles) {
|
||||
expect(existsSync(join(storiesDir, filename)), `${filename} is missing`).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
test("keeps Storybook fixtures generic and content-free", () => {
|
||||
const storyText = readdirSync(storiesDir)
|
||||
.filter((filename) => filename.endsWith(".svelte") || filename.endsWith(".ts"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue