fix(titlebar): reserve Windows window controls for logo
This commit is contained in:
1 parent
d83757a115
commit
e800d42595
5 files changed
+98
-6
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { closeElectronApp, expect, getStableWindow, test } from './fixtures/electron';
|
||||
|
||||
test('keeps the Canvas logo clear of Windows window controls', async ({ launchElectronApp }) => {
|
||||
test.skip(process.platform !== 'win32', 'Windows custom titlebar only');
|
||||
const app = await launchElectronApp({ skipSetup: true });
|
||||
|
||||
try {
|
||||
const page = await getStableWindow(app);
|
||||
await expect(page.getByTestId('ai-module-selection-page')).toBeVisible();
|
||||
await page.getByTestId('ai-module-option-painting').click();
|
||||
|
||||
const logoBounds = await page.getByTestId('titlebar-logo').boundingBox();
|
||||
const minimizeBounds = await page.getByTitle('Minimize').boundingBox();
|
||||
expect(logoBounds).not.toBeNull();
|
||||
expect(minimizeBounds).not.toBeNull();
|
||||
expect(logoBounds!.x + logoBounds!.width).toBeLessThanOrEqual(minimizeBounds!.x);
|
||||
} finally {
|
||||
await closeElectronApp(app);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user