mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
1be43911b4
Set Prettier's "trailingComma" setting to "es5" GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
35 lines
932 B
JavaScript
35 lines
932 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
|
|
)
|
|
}
|