refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -28,6 +28,7 @@ describe("Storybook isolated product examples", () => {
|
||||
vi.spyOn(Document.prototype, "cookie", "get"),
|
||||
vi.spyOn(Document.prototype, "cookie", "set"),
|
||||
];
|
||||
|
||||
const stories = [
|
||||
...Object.values(composeStories(AccountStories, preview)),
|
||||
...Object.values(composeStories(LoadingStories, preview)),
|
||||
@@ -39,16 +40,20 @@ describe("Storybook isolated product examples", () => {
|
||||
...Object.values(composeStories(IncomePeriodStories, preview)),
|
||||
...Object.values(composeStories(OperationStories, preview)),
|
||||
];
|
||||
|
||||
for (const Story of stories) {
|
||||
render(<Story />);
|
||||
for (const button of screen.queryAllByRole("button"))
|
||||
fireEvent.click(button);
|
||||
for (const link of screen.queryAllByRole("link")) fireEvent.click(link);
|
||||
|
||||
for (const image of screen.queryAllByRole("img")) {
|
||||
expect(image).not.toHaveAttribute("src");
|
||||
}
|
||||
|
||||
cleanup();
|
||||
}
|
||||
|
||||
for (const spy of spies) expect(spy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user