fix: fixing another locator for e2e test

This commit is contained in:
Kevin
2025-06-26 14:21:03 -05:00
parent d867d825c9
commit 9ea06ae579
3 changed files with 13 additions and 8 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)