Skip to content

Commit 14d331b

Browse files
authored
fix: use ariakit/test instead of local customs (#12)
1 parent 0e1113c commit 14d331b

File tree

8 files changed

+49
-42
lines changed

8 files changed

+49
-42
lines changed

.changeset/red-fireants-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@fuels/jest': patch
3+
---
4+
5+
Fix: put it back `press()` methods, but now using `@ariakit/test` to avoid having things locally customized

packages/jest/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"ts:check": "tsc --noEmit"
3939
},
4040
"dependencies": {
41+
"@ariakit/test": "^0.2.2",
4142
"@chakra-ui/utils": "^2.0.15",
4243
"@testing-library/dom": "^9.3.1",
4344
"@testing-library/jest-dom": "^6.1.2",

packages/jest/src/focus.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/jest/src/hooks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="@types/react-dom/test-utils" />
2-
import { renderHook, act } from '@testing-library/react';
2+
import { act } from '@ariakit/test';
3+
import { renderHook } from '@testing-library/react';
34

45
export const hooks = {
56
render: renderHook,

packages/jest/src/index.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
export {
22
act,
3+
focus,
4+
blur,
5+
click,
36
fireEvent,
7+
hover,
8+
mouseDown,
9+
mouseUp,
10+
press,
411
screen,
12+
select,
13+
sleep,
14+
tap,
15+
type,
516
waitFor,
6-
RenderResult,
7-
} from '@testing-library/react';
17+
within,
18+
} from '@ariakit/test';
19+
20+
export { RenderResult } from '@testing-library/react';
21+
822
export * from './accessibility';
9-
export { blur, focus } from './focus';
1023
export * from './hooks';
1124
export * from './mocks';
1225
export { render } from './render';

packages/jest/src/render.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { press } from '@ariakit/test';
12
import '@testing-library/jest-dom';
23
import type { RenderOptions } from '@testing-library/react';
34
import { render as rtlRender } from '@testing-library/react';
@@ -11,7 +12,7 @@ export function render(
1112
ui: React.ReactElement,
1213
options: RenderOptions = {},
1314
): ReturnType<typeof rtlRender> & { user: ReturnType<typeof userEvent.setup> } {
14-
const user = userEvent.setup();
15+
const user = { ...userEvent.setup(), press };
1516
const result = rtlRender(ui, options);
1617
return { user, ...result };
1718
}

packages/jest/src/utils.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)