mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 07:40:59 +00:00
ee79728bf9
GitOrigin-RevId: cc5a36be20c673f8941a2694eaeba80eebb4db6a
35 lines
929 B
JavaScript
35 lines
929 B
JavaScript
import React from 'react'
|
|
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
|
|
)
|
|
}
|