2020-11-26 09:22:30 -05:00
|
|
|
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',
|
2021-03-18 05:52:36 -04:00
|
|
|
rootFolder: [
|
|
|
|
{
|
|
|
|
docs: [],
|
|
|
|
fileRefs: [],
|
|
|
|
folders: []
|
|
|
|
}
|
|
|
|
],
|
2020-11-26 09:22:30 -05:00
|
|
|
hasWritePermissions: true,
|
2021-03-18 05:52:36 -04:00
|
|
|
hasFeature: () => true,
|
|
|
|
refProviders: {},
|
|
|
|
reindexReferences: () => {
|
|
|
|
console.log('reindex references')
|
|
|
|
},
|
|
|
|
setRefProviderEnabled: provider => {
|
|
|
|
console.log(`ref provider ${provider} enabled`)
|
|
|
|
},
|
|
|
|
setStartedFreeTrial: () => {
|
|
|
|
console.log('started free trial')
|
|
|
|
},
|
2020-11-26 09:22:30 -05:00
|
|
|
onSelect: () => {},
|
|
|
|
...contextProps
|
|
|
|
}
|
|
|
|
return render(
|
|
|
|
<FileTreeContext {...contextProps}>{children}</FileTreeContext>,
|
|
|
|
renderOptions
|
|
|
|
)
|
|
|
|
}
|