generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): WIP add unit tests for drawer | tg / rd | #28
preparing storybook unit tests
- Loading branch information
1 parent
eaf2cd4
commit 2d04ccc
Showing
4 changed files
with
5 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,13 @@ | ||
import { composeStory } from "@storybook/react" | ||
import "@testing-library/jest-dom" | ||
import { render } from "@testing-library/react" | ||
// import * as DrawerUtils from "./drawer" | ||
// import { Drawer, type DrawerProps } from "./drawer" | ||
import { render, screen } from "@testing-library/react" | ||
import Meta, { Default } from "./drawer.stories" | ||
|
||
const DrawerDefault = composeStory(Default, Meta) // default placement is "right" | ||
|
||
describe("DrawerRoot", () => { | ||
it("should return the correct markup for placement='right'", () => { | ||
// const spy = jest.spyOn(DrawerUtils, "DrawerRoot") | ||
|
||
it("should return the correct markup for placement='right'", async () => { | ||
render(<DrawerDefault />) | ||
expect(true).toBeFalsy() | ||
|
||
// expect(spy).toBeCalled() | ||
|
||
/*render(<FormError />) | ||
const buttonElement = screen.getByRole("button", { | ||
name: "Submit", | ||
}) | ||
fireEvent.click(buttonElement) | ||
const isFormValid = screen.getByLabelText("invalid-form") | ||
expect(isFormValid).toBeInTheDocument()*/ | ||
expect(screen.getByRole("dialog")).toBeInTheDocument() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters