mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
* Remove `$scope` from `getMockIde` * Replace `...getMockIde()` by `_id: projectId` * Simplify stories decorator scope.tsx: less reliance on `window` * Update helper editor-providers.jsx: pass data instead directly instead of using `window` * Remove `cleanUpContext` * Remove unused prop `clsiServerId` * Update types to reflect unused properties * Remove comment * Add `ol-chatEnabled` in Storybook * Revert moving `getMeta` outside of the component This causes issues in Storybook GitOrigin-RevId: dc2558ce814c2d738fb39450c57c104f4419efb8
21 lines
504 B
JavaScript
21 lines
504 B
JavaScript
// Disable prop type checks for test harnesses
|
|
/* eslint-disable react/prop-types */
|
|
|
|
import { render } from '@testing-library/react'
|
|
import { EditorProviders } from './editor-providers'
|
|
|
|
export function renderWithEditorContext(
|
|
component,
|
|
contextProps,
|
|
renderOptions = {}
|
|
) {
|
|
const EditorProvidersWrapper = ({ children }) => (
|
|
<EditorProviders {...contextProps}>{children}</EditorProviders>
|
|
)
|
|
|
|
return render(component, {
|
|
wrapper: EditorProvidersWrapper,
|
|
...renderOptions,
|
|
})
|
|
}
|