Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a test for foreign characters in project name #4976

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
})
}
)
Loading