mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #6210 from overleaf/ta-file-tree-data-in-context
Remove rootFolder from EditorContext GitOrigin-RevId: 827b046046265ad2418eb91d5a69eae02aa8b5a4
This commit is contained in:
+5
-5
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types'
|
||||
import renderWithContext from '../../helpers/render-with-context'
|
||||
import FileTreeModalCreateFile from '../../../../../../frontend/js/features/file-tree/components/modals/file-tree-modal-create-file'
|
||||
import { useFileTreeActionable } from '../../../../../../frontend/js/features/file-tree/contexts/file-tree-actionable'
|
||||
import { useFileTreeMutable } from '../../../../../../frontend/js/features/file-tree/contexts/file-tree-mutable'
|
||||
import { useFileTreeData } from '../../../../../../frontend/js/shared/context/file-tree-data-context'
|
||||
|
||||
describe('<FileTreeModalCreateFile/>', function () {
|
||||
beforeEach(function () {
|
||||
@@ -65,7 +65,7 @@ describe('<FileTreeModalCreateFile/>', function () {
|
||||
]
|
||||
|
||||
renderWithContext(<OpenWithMode mode="doc" />, {
|
||||
contextProps: { projectRootFolder: rootFolder },
|
||||
contextProps: { rootFolder },
|
||||
})
|
||||
|
||||
screen.getByRole(
|
||||
@@ -89,7 +89,7 @@ describe('<FileTreeModalCreateFile/>', function () {
|
||||
]
|
||||
|
||||
renderWithContext(<OpenWithMode mode="doc" />, {
|
||||
contextProps: { projectRootFolder: rootFolder },
|
||||
contextProps: { rootFolder },
|
||||
})
|
||||
|
||||
screen.getByText(/This project is approaching the file limit \(\d+\/\d+\)/)
|
||||
@@ -127,7 +127,7 @@ describe('<FileTreeModalCreateFile/>', function () {
|
||||
]
|
||||
|
||||
renderWithContext(<OpenWithMode mode="doc" />, {
|
||||
contextProps: { projectRootFolder: rootFolder },
|
||||
contextProps: { rootFolder },
|
||||
})
|
||||
|
||||
screen.getByText(/This project is approaching the file limit \(\d+\/\d+\)/)
|
||||
@@ -458,7 +458,7 @@ describe('<FileTreeModalCreateFile/>', function () {
|
||||
function OpenWithMode({ mode }) {
|
||||
const { newFileCreateMode, startCreatingFile } = useFileTreeActionable()
|
||||
|
||||
const { fileCount } = useFileTreeMutable()
|
||||
const { fileCount } = useFileTreeData()
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
useEffect(() => startCreatingFile(mode), [])
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('<FileTreeDoc/>', function () {
|
||||
<FileTreeDoc name="foo.tex" id="123abc" isLinkedFile={false} />,
|
||||
{
|
||||
contextProps: {
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
@@ -50,7 +50,7 @@ describe('<FileTreeDoc/>', function () {
|
||||
it('selects', function () {
|
||||
renderWithContext(<FileTreeDoc name="foo.tex" id="123abc" expanded />, {
|
||||
contextProps: {
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
@@ -71,7 +71,7 @@ describe('<FileTreeDoc/>', function () {
|
||||
it('multi-selects', function () {
|
||||
renderWithContext(<FileTreeDoc name="foo.tex" id="123abc" expanded />, {
|
||||
contextProps: {
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ describe('<FileTreeFolderList/>', function () {
|
||||
{
|
||||
contextProps: {
|
||||
permissionsLevel: 'readOnly',
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
@@ -80,7 +80,7 @@ describe('<FileTreeFolderList/>', function () {
|
||||
<FileTreeFolderList folders={[]} docs={docs} files={[]} />,
|
||||
{
|
||||
contextProps: {
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('<FileTreeFolder/>', function () {
|
||||
/>,
|
||||
{
|
||||
contextProps: {
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
@@ -66,7 +66,7 @@ describe('<FileTreeFolder/>', function () {
|
||||
/>,
|
||||
{
|
||||
contextProps: {
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
@@ -97,7 +97,7 @@ describe('<FileTreeFolder/>', function () {
|
||||
/>,
|
||||
{
|
||||
contextProps: {
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ describe('<FileTreeitemInner />', function () {
|
||||
{
|
||||
contextProps: {
|
||||
rootDocId: '123abc',
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('<FileTreeRoot/>', function () {
|
||||
isConnected
|
||||
/>,
|
||||
{
|
||||
projectRootFolder: rootFolder,
|
||||
rootFolder,
|
||||
projectId: '123abc',
|
||||
rootDocId: '456def',
|
||||
features: {},
|
||||
@@ -86,7 +86,7 @@ describe('<FileTreeRoot/>', function () {
|
||||
isConnected
|
||||
/>,
|
||||
{
|
||||
projectRootFolder: rootFolder,
|
||||
rootFolder,
|
||||
projectId: '123abc',
|
||||
rootDocId: '456def',
|
||||
features: {},
|
||||
@@ -128,7 +128,7 @@ describe('<FileTreeRoot/>', function () {
|
||||
setStartedFreeTrial={() => null}
|
||||
/>,
|
||||
{
|
||||
projectRootFolder: rootFolder,
|
||||
rootFolder,
|
||||
projectId: '123abc',
|
||||
rootDocId: '456def',
|
||||
features: {},
|
||||
@@ -163,7 +163,7 @@ describe('<FileTreeRoot/>', function () {
|
||||
isConnected
|
||||
/>,
|
||||
{
|
||||
projectRootFolder: rootFolder,
|
||||
rootFolder,
|
||||
projectId: '123abc',
|
||||
rootDocId: '456def',
|
||||
features: {},
|
||||
@@ -219,7 +219,7 @@ describe('<FileTreeRoot/>', function () {
|
||||
isConnected
|
||||
/>,
|
||||
{
|
||||
projectRootFolder: rootFolder,
|
||||
rootFolder,
|
||||
projectId: '123abc',
|
||||
rootDocId: '456def',
|
||||
features: {},
|
||||
@@ -266,7 +266,7 @@ describe('<FileTreeRoot/>', function () {
|
||||
isConnected
|
||||
/>,
|
||||
{
|
||||
projectRootFolder: rootFolder,
|
||||
rootFolder,
|
||||
projectId: '123abc',
|
||||
rootDocId: '456def',
|
||||
features: {},
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('<FileTreeToolbar/>', function () {
|
||||
renderWithContext(<FileTreeToolbar />, {
|
||||
contextProps: {
|
||||
rootDocId: '456def',
|
||||
projectRootFolder: [
|
||||
rootFolder: [
|
||||
{
|
||||
_id: 'root-folder-id',
|
||||
name: 'rootFolder',
|
||||
|
||||
Reference in New Issue
Block a user