fix: fixing another locator for e2e test
This commit is contained in:
@ -543,10 +543,8 @@ test.describe('Renaming in the file tree', () => {
|
|||||||
// Constants and locators
|
// Constants and locators
|
||||||
const projectLink = page.getByText('Test Project')
|
const projectLink = page.getByText('Test Project')
|
||||||
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
|
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
|
||||||
const folderToRename = page.getByRole('button', {
|
const folderToRename = u.locatorFolder('folderToRename')
|
||||||
name: 'folderToRename',
|
const renamedFolder = u.locatorFolder('newFolderName')
|
||||||
})
|
|
||||||
const renamedFolder = page.getByRole('button', { name: 'newFolderName' })
|
|
||||||
const renameMenuItem = page.getByRole('button', { name: 'Rename' })
|
const renameMenuItem = page.getByRole('button', { name: 'Rename' })
|
||||||
const originalFolderName = 'folderToRename'
|
const originalFolderName = 'folderToRename'
|
||||||
const renameInput = page.getByPlaceholder(originalFolderName)
|
const renameInput = page.getByPlaceholder(originalFolderName)
|
||||||
|
|||||||
@ -130,7 +130,10 @@ export const ProjectExplorer = ({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const row = rowsToRenderRef.current[activeIndexRef.current] || rowsToRenderRef.current[lastIndexBeforeNothing.current] || null
|
const row =
|
||||||
|
rowsToRenderRef.current[activeIndexRef.current] ||
|
||||||
|
rowsToRenderRef.current[lastIndexBeforeNothing.current] ||
|
||||||
|
null
|
||||||
setFakeRow({ entry: row, isFile: true })
|
setFakeRow({ entry: row, isFile: true })
|
||||||
if (row?.key) {
|
if (row?.key) {
|
||||||
// If the file tree had the folder opened make the new one open.
|
// If the file tree had the folder opened make the new one open.
|
||||||
@ -144,7 +147,10 @@ export const ProjectExplorer = ({
|
|||||||
if (createFolderPressed <= 0 || readOnly) {
|
if (createFolderPressed <= 0 || readOnly) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const row = rowsToRenderRef.current[activeIndexRef.current] || rowsToRenderRef.current[lastIndexBeforeNothing.current] || null
|
const row =
|
||||||
|
rowsToRenderRef.current[activeIndexRef.current] ||
|
||||||
|
rowsToRenderRef.current[lastIndexBeforeNothing.current] ||
|
||||||
|
null
|
||||||
setFakeRow({ entry: row, isFile: false })
|
setFakeRow({ entry: row, isFile: false })
|
||||||
if (row?.key) {
|
if (row?.key) {
|
||||||
// If the file tree had the folder opened make the new one open.
|
// If the file tree had the folder opened make the new one open.
|
||||||
@ -204,7 +210,6 @@ export const ProjectExplorer = ({
|
|||||||
setIsRenaming(false)
|
setIsRenaming(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// gotcha: sync state
|
// gotcha: sync state
|
||||||
openedRowsRef.current = openedRows
|
openedRowsRef.current = openedRows
|
||||||
activeIndexRef.current = activeIndex
|
activeIndexRef.current = activeIndex
|
||||||
|
|||||||
@ -609,7 +609,9 @@ export const systemIOMachineDesktop = systemIOMachine.provide({
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e === 'ENOENT') {
|
if (e === 'ENOENT') {
|
||||||
console.warn(`checking if folder is created, ${input.requestedAbsolutePath}`)
|
console.warn(
|
||||||
|
`checking if folder is created, ${input.requestedAbsolutePath}`
|
||||||
|
)
|
||||||
console.warn(e)
|
console.warn(e)
|
||||||
} else {
|
} else {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user