From d7229ba42687f669861279682f7b010a635c0008 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 7 Jan 2025 18:22:03 -0800 Subject: [PATCH] add a test for foreign characters in project name Signed-off-by: Jess Frazelle --- e2e/playwright/projects.spec.ts | 51 +++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/e2e/playwright/projects.spec.ts b/e2e/playwright/projects.spec.ts index 7ecb99032e..38b8324732 100644 --- a/e2e/playwright/projects.spec.ts +++ b/e2e/playwright/projects.spec.ts @@ -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) => { @@ -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) => { @@ -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) => { @@ -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) + }) + } +)