Skip to content

Commit 476540b

Browse files
committed
Refine test
1 parent 2b21335 commit 476540b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/code-view/__tests__/code-view.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { cleanup, getByText, render } from "@testing-library/react";
44
import { afterEach, describe, expect, test } from "vitest";
55

6-
import CodeView from "../../../lib/components/code-view";
6+
import CodeView, { CodeViewProps } from "../../../lib/components/code-view";
77
import typescriptHighlightRules from "../../../lib/components/code-view/highlight/typescript";
88
import createWrapper from "../../../lib/components/test-utils/dom";
99

@@ -105,7 +105,8 @@ describe("CodeView", () => {
105105
});
106106

107107
test("handles undefined content", () => {
108-
render(<CodeView content={undefined}></CodeView>);
108+
const props = {} as CodeViewProps;
109+
render(<CodeView {...props}></CodeView>);
109110
const wrapper = createWrapper().findCodeView()!;
110111
expect(wrapper!.findContent().getElement().textContent).toBe("\n");
111112
});

0 commit comments

Comments
 (0)