mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
1fcf94c3b9
React shared context GitOrigin-RevId: ebc6fa90dd8c65ddf803fd457c99a30f0e8e3c9c
14 lines
565 B
JavaScript
14 lines
565 B
JavaScript
import React from 'react'
|
|
import { render } from '@testing-library/react'
|
|
import { ApplicationProvider } from '../../../frontend/js/shared/context/application-context'
|
|
import { EditorProvider } from '../../../frontend/js/shared/context/editor-context'
|
|
|
|
export function renderWithEditorContext(children, { user, projectId } = {}) {
|
|
window.user = user || window.user
|
|
window.project_id = projectId != null ? projectId : window.project_id
|
|
return render(
|
|
<ApplicationProvider>
|
|
<EditorProvider>{children}</EditorProvider>
|
|
</ApplicationProvider>
|
|
)
|
|
}
|