mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
7c97f8ab6e
* Use new JSX runtime and update Babel Node target * Update .eslintrc * Remove React imports GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
34 lines
906 B
JavaScript
34 lines
906 B
JavaScript
import { render } from '@testing-library/react'
|
|
import FileTreeContext from '../../../../../frontend/js/features/file-tree/components/file-tree-context'
|
|
|
|
export default (children, options = {}) => {
|
|
let { contextProps = {}, ...renderOptions } = options
|
|
contextProps = {
|
|
projectId: '123abc',
|
|
rootFolder: [
|
|
{
|
|
docs: [],
|
|
fileRefs: [],
|
|
folders: [],
|
|
},
|
|
],
|
|
hasWritePermissions: true,
|
|
userHasFeature: () => true,
|
|
refProviders: {},
|
|
reindexReferences: () => {
|
|
console.log('reindex references')
|
|
},
|
|
setRefProviderEnabled: provider => {
|
|
console.log(`ref provider ${provider} enabled`)
|
|
},
|
|
setStartedFreeTrial: () => {
|
|
console.log('started free trial')
|
|
},
|
|
onSelect: () => {},
|
|
...contextProps,
|
|
}
|
|
return render(
|
|
<FileTreeContext {...contextProps}>{children}</FileTreeContext>,
|
|
renderOptions
|
|
)
|
|
}
|