Skip to content

Commit

Permalink
add a test for foreign characters in project name
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Jan 8, 2025
1 parent a9ceaf2 commit d7229ba
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions e2e/playwright/projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ test(
)

test(
'yyyyyyyyy open a file in a project works and renders, open another file in different project with errors, it should clear the scene',
'open a file in a project works and renders, open another file in different project with errors, it should clear the scene',
{ tag: '@electron' },
async ({ context, page }, testInfo) => {
await context.folderSetupFn(async (dir) => {
Expand Down Expand Up @@ -199,7 +199,7 @@ test(
)

test(
'aaayyyyyyyy open a file in a project works and renders, open another file in different project that is empty, it should clear the scene',
'open a file in a project works and renders, open another file in different project that is empty, it should clear the scene',
{ tag: '@electron' },
async ({ context, page }, testInfo) => {
await context.folderSetupFn(async (dir) => {
Expand Down Expand Up @@ -276,7 +276,7 @@ test(
)

test(
'nooooooooooooo open a file in a project works and renders, open empty file, it should clear the scene',
'open a file in a project works and renders, open empty file, it should clear the scene',
{ tag: '@electron' },
async ({ context, page }, testInfo) => {
await context.folderSetupFn(async (dir) => {
Expand Down Expand Up @@ -1885,3 +1885,48 @@ test.fixme(
})
}
)

test(
'project name with foreign characters should open',
{ tag: '@electron' },
async ({ context, page }, testInfo) => {
await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'اَلْعَرَبِيَّةُ')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile(
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl')
)

await fsp.writeFile(path.join(bracketDir, 'empty.kcl'), '')
})

await page.setBodyDimensions({ width: 1200, height: 500 })
const u = await getUtils(page)

page.on('console', console.log)

const pointOnModel = { x: 630, y: 280 }

await test.step('Opening the اَلْعَرَبِيَّةُ project should load the stream', async () => {
// expect to see the text bracket
await expect(page.getByText('اَلْعَرَبِيَّةُ')).toBeVisible()

await page.getByText('اَلْعَرَبِيَّةُ').click()

await expect(
page.getByRole('button', { name: 'Start Sketch' })
).toBeEnabled({
timeout: 20_000,
})

// gray at this pixel means the stream has loaded in the most
// user way we can verify it (pixel color)
await expect
.poll(() => u.getGreatestPixDiff(pointOnModel, [85, 85, 85]), {
timeout: 10_000,
})
.toBeLessThan(15)
})
}
)

0 comments on commit d7229ba

Please sign in to comment.