Skip to content

Commit 14c7754

Browse files
committed
test: add Copied test case.
1 parent e892873 commit 14c7754

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/section/Copied.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ it('renders <JsonView.Copied /> copy Infinity test case', async () => {
161161
<JsonView value={{ value: BigInt(1000) }}>
162162
<JsonView.Copied data-testid="copied" />
163163
<JsonView.Quote data-testid="quote" />
164+
<JsonView.Bigint data-testid="bigint" />
164165
</JsonView>,
165166
);
166167
expect(container.firstElementChild).toBeInstanceOf(Element);
@@ -170,5 +171,8 @@ it('renders <JsonView.Copied /> copy Infinity test case', async () => {
170171
const copied = screen.getAllByTestId('copied')[1];
171172
await user.click(copied);
172173
expect(navigator.clipboard.writeText).toHaveBeenCalledWith('1000n');
174+
fireEvent.mouseLeave(lineDom);
175+
const bigint = screen.getAllByTestId('bigint')[1];
176+
expect(bigint.nextElementSibling).toBeNull();
173177
jest.restoreAllMocks();
174178
});

0 commit comments

Comments
 (0)