mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-17 23:31:14 -05:00
aa480a2663
[web] migrate from window attributes to getMeta GitOrigin-RevId: 3dcf1ab6b01155e5e4abeb3e78d0fa9053e055bc
24 lines
563 B
JavaScript
24 lines
563 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,
|
|
})
|
|
}
|
|
|
|
export function cleanUpContext() {
|
|
delete window._ide
|
|
}
|