Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
Fix window control tests for localized labels
Leggetta66863aabbdf
diff --git a/apps/desktop/e2e/creator-packaged-app.spec.ts b/apps/desktop/e2e/creator-packaged-app.spec.tsindex a053eec1..79f20deb 100644--- a/apps/desktop/e2e/creator-packaged-app.spec.ts+++ b/apps/desktop/e2e/creator-packaged-app.spec.ts@@ -251,7 +251,7 @@ test('打包 App 的浅色窗口按钮区域与设置侧栏连续且保留标题expect(await fixture.app.page.evaluate(() => (typeof window.opencreatorDesktop?.setWindowColorMode))).toBe('function');- await expect(fixture.app.page.getByRole('group', { name: 'Window controls' }).getByRole('button')).toHaveCount(3);+ await expect(fixture.app.page.getByRole('group', { name: '窗口控制' }).getByRole('button')).toHaveCount(3);for (const action of ['close', 'minimize', 'zoom']) {const background = await fixture.app.page.locator(`.desktop-window-control-${action}`).evaluate(element =>getComputedStyle(element).backgroundColor@@ -268,9 +268,9 @@ test('打包 App 的浅色窗口按钮区域与设置侧栏连续且保留标题const title = document.querySelector('.creator-tools-page-header h1')!.getBoundingClientRect();return Math.round((brand.top + brand.bottom - title.top - title.bottom) / 2);})).toBeLessThanOrEqual(3);- await fixture.app.page.getByRole('button', { name: 'Zoom window' }).click();+ await fixture.app.page.getByRole('button', { name: '缩放窗口' }).click();await expect.poll(() => fixture.app.page.evaluate(() => window.innerWidth)).toBeGreaterThan(980);- await fixture.app.page.getByRole('button', { name: 'Zoom window' }).click();+ await fixture.app.page.getByRole('button', { name: '缩放窗口' }).click();await expect.poll(() => fixture.app.page.evaluate(() => window.innerWidth)).toBe(980);await fixture.app.page.getByRole('button', { name: '我的项目', exact: true }).click();await expect(fixture.app.page.getByRole('heading', { name: '我的项目' })).toBeVisible();diff --git a/apps/desktop/e2e/desktop.spec.ts b/apps/desktop/e2e/desktop.spec.tsindex f705e8d6..678a8b41 100644--- a/apps/desktop/e2e/desktop.spec.ts+++ b/apps/desktop/e2e/desktop.spec.ts@@ -428,7 +428,7 @@ test('@package-smoke 授权回调唤起个人中心,模型初始化期间立if (-not [OpenCreatorE2EWindow]::IsIconic($windowHandle)) { throw 'Desktop native window did not minimize'; }`], { timeout: 10_000 });} else {- await fixture.page.getByRole('button', { name: 'Minimize window', exact: true }).click();+ await fixture.page.getByRole('button', { name: '最小化窗口', exact: true }).click();}approved = true;const checks: string[] = [];diff --git a/apps/web/src/app/App.test.tsx b/apps/web/src/app/App.test.tsxindex 51b88a48..bbeca938 100644--- a/apps/web/src/app/App.test.tsx+++ b/apps/web/src/app/App.test.tsx@@ -1296,7 +1296,7 @@ describe('App', () => {expect(shell?.style.getPropertyValue('--opencreator-titlebar-height')).toBe('38px');expect(shell?.style.getPropertyValue('--opencreator-traffic-light-inset')).toBe('76px');expect(document.querySelector('.desktop-titlebar-drag-region')).toBeInTheDocument();- expect(screen.queryByRole('group', { name: 'Window controls' })).not.toBeInTheDocument();+ expect(screen.queryByRole('group', { name: '窗口控制' })).not.toBeInTheDocument();expect(document.querySelector('.opencreator-main-titlebar')).not.toBeInTheDocument();});@@ -1314,10 +1314,10 @@ describe('App', () => {render(<App fileService={createFileService()} hostBridge={hostBridge} />);await screen.findByRole('button', { name: '工作台' });- const controls = screen.getByRole('group', { name: 'Window controls' });- await user.click(within(controls).getByRole('button', { name: 'Zoom window' }));- await user.click(within(controls).getByRole('button', { name: 'Minimize window' }));- await user.click(within(controls).getByRole('button', { name: 'Close window' }));+ const controls = screen.getByRole('group', { name: '窗口控制' });+ await user.click(within(controls).getByRole('button', { name: '缩放窗口' }));+ await user.click(within(controls).getByRole('button', { name: '最小化窗口' }));+ await user.click(within(controls).getByRole('button', { name: '关闭窗口' }));expect(controlWindow.mock.calls).toEqual([['zoom'], ['minimize'], ['close']]);});