Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit ef24187

Browse files
committed
refactor: extract default providers mocks
1 parent d61655f commit ef24187

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

tests/test-utils/providers-mock.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import icons from '@/packages/chakra-ui-core/src/lib/internal-icons'
2+
import theme from '@/packages/chakra-ui-core/src/lib/theme'
3+
4+
const defaultProviders = options => ({
5+
$chakraTheme: () => theme,
6+
$chakraColorMode: () => 'light',
7+
$chakraIcons: icons,
8+
...options
9+
})
10+
11+
export default defaultProviders
12+
export { icons, theme }

tests/test-utils/test-utils.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@ import '@testing-library/jest-dom/extend-expect'
22
import * as vtl from '@testing-library/vue'
33
import userEvent from '@testing-library/user-event'
44

5-
import icons from '@/packages/chakra-ui-core/src/lib/internal-icons'
6-
import theme from '@/packages/chakra-ui-core/src/lib/theme'
7-
const defaultProviders = options => ({
8-
$chakraTheme: () => theme,
9-
$chakraColorMode: () => 'light',
10-
$chakraIcons: icons,
11-
...options
12-
})
5+
import defaultProviders from './providers-mock'
136

147
const render = (component, ...rest) => {
158
const defaults = {

0 commit comments

Comments
 (0)