|
1 | | -import App from "./example/App.svelte"; |
2 | | -import { render, fireEvent, waitForElement, cleanup } from "../src"; |
| 1 | +import {render, fireEvent, waitForElement, cleanup} from '../src' |
| 2 | +import App from './example/App.svelte' |
| 3 | +import 'jest-dom/extend-expect' |
3 | 4 |
|
4 | | -afterEach(cleanup); |
5 | | -describe("queries", () => { |
6 | | - test("getByText", () => { |
7 | | - const { getByText } = render(App, { name: "world" }); |
| 5 | +afterEach(cleanup) |
| 6 | +describe('queries', () => { |
| 7 | + test('getByText', () => { |
| 8 | + const {getByText} = render(App, {name: 'world'}) |
8 | 9 |
|
9 | | - expect(getByText("Hello world!")); |
10 | | - }); |
| 10 | + expect(getByText('Hello world!')).toBeInTheDocument() |
| 11 | + }) |
11 | 12 |
|
12 | | - test("click button", async () => { |
13 | | - const { getByText } = render(App, { name: "world" }); |
| 13 | + test('click button', async () => { |
| 14 | + const {getByText} = render(App, {name: 'world'}) |
14 | 15 |
|
15 | | - fireEvent.click(getByText("Button Text")); |
| 16 | + fireEvent.click(getByText('Button Text')) |
16 | 17 |
|
17 | | - const button = await waitForElement(() => getByText("Button Clicked")); |
| 18 | + const button = await waitForElement(() => getByText('Button Clicked')) |
18 | 19 |
|
19 | | - expect(button); |
20 | | - }); |
21 | | -}); |
| 20 | + expect(button).toBeInTheDocument() |
| 21 | + }) |
| 22 | +}) |
0 commit comments