Skip to content

Commit

Permalink
revert: testing library 버전 revert (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 committed Apr 29, 2024
1 parent 368c30c commit 483d648
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 37 deletions.
118 changes: 109 additions & 9 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@rollup/plugin-typescript": "^11.1.2",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^15.0.4",
"@testing-library/react": "^14.3.1",
"@testing-library/user-event": "^14.5.1",
"@types/lodash-es": "^4",
"@types/react": "^18.2.20",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ describe('DebounceWrapper Component', () => {
);

const button = screen.getByRole('button');
user.click(button);
await user.click(button);

await vi.advanceTimersByTimeAsync(300);
vi.advanceTimersByTime(300);
expect(mockFn).not.toBeCalled();

await vi.advanceTimersByTimeAsync(200);
vi.advanceTimersByTime(200);
expect(mockFn).toBeCalledTimes(1);

user.click(button);
user.click(button);
user.click(button);
await user.click(button);
await user.click(button);
await user.click(button);

await vi.advanceTimersByTimeAsync(300);
vi.advanceTimersByTime(300);
expect(mockFn).toBeCalledTimes(1);

await vi.advanceTimersByTimeAsync(200);
Expand All @@ -98,23 +98,23 @@ describe('DebounceWrapper Component', () => {
const input = screen.getByRole('textbox');
const paragraph = screen.getByRole('paragraph');

user.type(input, 'Debounce');
await user.type(input, 'Debounce');

await vi.advanceTimersByTimeAsync(300);
vi.advanceTimersByTime(300);
expect(paragraph).toHaveTextContent('');
expect(input).toHaveValue('Debounce');

await vi.advanceTimersByTimeAsync(200);
vi.advanceTimersByTime(200);
expect(paragraph).toHaveTextContent('Debounce');
expect(input).toHaveValue('Debounce');

user.type(input, ' Test');
await user.type(input, ' Test');

await vi.advanceTimersByTimeAsync(300);
vi.advanceTimersByTime(300);
expect(paragraph).toHaveTextContent('Debounce');
expect(input).toHaveValue('Debounce Test');

await vi.advanceTimersByTimeAsync(200);
vi.advanceTimersByTime(200);
expect(paragraph).toHaveTextContent('Debounce Test');
expect(input).toHaveValue('Debounce Test');
});
Expand Down

0 comments on commit 483d648

Please sign in to comment.