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
|
||||
const projectLink = page.getByText('Test Project')
|
||||
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
|
||||
const folderToRename = page.getByRole('button', {
|
||||
name: 'folderToRename',
|
||||
})
|
||||
const renamedFolder = page.getByRole('button', { name: 'newFolderName' })
|
||||
const folderToRename = u.locatorFolder('folderToRename')
|
||||
const renamedFolder = u.locatorFolder('newFolderName')
|
||||
const renameMenuItem = page.getByRole('button', { name: 'Rename' })
|
||||
const originalFolderName = 'folderToRename'
|
||||
const renameInput = page.getByPlaceholder(originalFolderName)
|
||||
|
||||
@ -130,7 +130,10 @@ export const ProjectExplorer = ({
|
||||
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 })
|
||||
if (row?.key) {
|
||||
// If the file tree had the folder opened make the new one open.
|
||||
@ -144,7 +147,10 @@ export const ProjectExplorer = ({
|
||||
if (createFolderPressed <= 0 || readOnly) {
|
||||
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 })
|
||||
if (row?.key) {
|
||||
// If the file tree had the folder opened make the new one open.
|
||||
@ -204,7 +210,6 @@ export const ProjectExplorer = ({
|
||||
setIsRenaming(false)
|
||||
}
|
||||
|
||||
|
||||
// gotcha: sync state
|
||||
openedRowsRef.current = openedRows
|
||||
activeIndexRef.current = activeIndex
|
||||
|
||||
@ -609,7 +609,9 @@ export const systemIOMachineDesktop = systemIOMachine.provide({
|
||||
}
|
||||
} catch (e) {
|
||||
if (e === 'ENOENT') {
|
||||
console.warn(`checking if folder is created, ${input.requestedAbsolutePath}`)
|
||||
console.warn(
|
||||
`checking if folder is created, ${input.requestedAbsolutePath}`
|
||||
)
|
||||
console.warn(e)
|
||||
} else {
|
||||
console.error(e)
|
||||
|
||||
Reference in New Issue
Block a user