Corrected a fixme in file-tree.spec!

This commit is contained in:
49lf
2024-11-27 14:02:01 -05:00
parent b3cc43ae2f
commit ccfc592b62
2 changed files with 11 additions and 11 deletions

View File

@ -130,8 +130,8 @@ test.describe('when using the file tree to', () => {
} }
) )
test.fixme( test(
`create many new untitled files they increment their names`, `create many new files of the same name, incrementing their names`,
{ tag: '@electron' }, { tag: '@electron' },
async ({ page }, testInfo) => { async ({ page }, testInfo) => {
const { panesOpen, createNewFile } = await getUtils(page, test) const { panesOpen, createNewFile } = await getUtils(page, test)
@ -143,17 +143,17 @@ test.describe('when using the file tree to', () => {
await createProject({ name: 'project-000', page }) await createProject({ name: 'project-000', page })
await createNewFile('') await createNewFile('lee')
await createNewFile('') await createNewFile('lee')
await createNewFile('') await createNewFile('lee')
await createNewFile('') await createNewFile('lee')
await createNewFile('') await createNewFile('lee')
await test.step('Postcondition: there are 5 new Untitled-*.kcl files', async () => { await test.step('Postcondition: there are 5 new lee-*.kcl files', async () => {
await expect( await expect(
page page
.locator('[data-testid="file-pane-scroll-container"] button') .locator('[data-testid="file-pane-scroll-container"] button')
.filter({ hasText: /Untitled[-]?[0-5]?/ }) .filter({ hasText: /lee[-]?[0-5]?/ })
).toHaveCount(5) ).toHaveCount(5)
}) })
} }

View File

@ -507,7 +507,7 @@ export async function getUtils(page: Page, test_?: typeof test) {
editorTextMatches: async (code: string) => { editorTextMatches: async (code: string) => {
const editor = page.locator(editorSelector) const editor = page.locator(editorSelector)
return expect(editor).toHaveText(code, { useInnerText: true }) return expect.poll(() => editor.textContent()).toContain(code)
}, },
pasteCodeInEditor: async (code: string) => { pasteCodeInEditor: async (code: string) => {
@ -533,7 +533,7 @@ export async function getUtils(page: Page, test_?: typeof test) {
page.getByRole('button', { name: 'Start Sketch' }) page.getByRole('button', { name: 'Start Sketch' })
).not.toBeDisabled() ).not.toBeDisabled()
await page.getByTestId('create-file-button').click() await page.getByTestId('create-file-button').click()
await page.getByTestId('file-rename-field').fill(name) await page.getByTestId('tree-input-field').fill(name)
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
}) })
}, },