mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Merge pull request #3559 from overleaf/ta-file-tree-404-fix
[ReactFileTree] Fix Handling of 404 on Deletion GitOrigin-RevId: 8b955710929246168ac5cc29acda7a893164fc1d
This commit is contained in:
@@ -179,7 +179,7 @@ export function useFileTreeActionable() {
|
||||
return syncDelete(projectId, found.type, found.entity._id).catch(
|
||||
error => {
|
||||
// throw unless 404
|
||||
if (error.info.statusCode !== '404') {
|
||||
if (error.info.statusCode !== 404) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ describe('FileTree Delete Entity Flow', function() {
|
||||
name: 'main.tex'
|
||||
})
|
||||
).to.not.exist
|
||||
|
||||
// check that the confirmation modal is closed
|
||||
expect(screen.queryByText(/Are you sure/)).to.not.exist
|
||||
})
|
||||
|
||||
const [lastFetchPath] = fetchMock.lastCall(fetchMatcher)
|
||||
@@ -88,6 +91,9 @@ describe('FileTree Delete Entity Flow', function() {
|
||||
|
||||
window._ide.socket.socketClient.emit('removeEntity', '456def')
|
||||
|
||||
// check that the confirmation modal is open
|
||||
screen.getByText(/Are you sure/)
|
||||
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.queryByRole('treeitem', {
|
||||
@@ -101,6 +107,10 @@ describe('FileTree Delete Entity Flow', function() {
|
||||
name: 'main.tex'
|
||||
})
|
||||
).to.not.exist
|
||||
|
||||
// check that the confirmation modal is closed
|
||||
// is not, the 404 probably triggered a bug
|
||||
expect(screen.queryByText(/Are you sure/)).to.not.exist
|
||||
})
|
||||
})
|
||||
|
||||
@@ -228,6 +238,9 @@ describe('FileTree Delete Entity Flow', function() {
|
||||
name
|
||||
})
|
||||
).to.not.exist
|
||||
|
||||
// check that the confirmation modal is closed
|
||||
expect(screen.queryByText(/Are you sure/)).to.not.exist
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user