feat: ui overhaul (#676)
This commit is contained in:
committed by
GitHub
parent
5c86462859
commit
66b81e9228
17
packages/core/test/test-utils.tsx
Normal file
17
packages/core/test/test-utils.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import { store } from '@staticcms/core/store';
|
||||
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
export function renderWithProviders(ui: React.ReactElement) {
|
||||
function Wrapper({ children }: PropsWithChildren<{}>): JSX.Element {
|
||||
return <Provider store={store}>{children}</Provider>;
|
||||
}
|
||||
|
||||
// Return an object with the store and all of RTL's query functions
|
||||
return { store, ...render(ui, { wrapper: Wrapper }) };
|
||||
}
|
Reference in New Issue
Block a user