Files
makelore/tests/e2e/windows-titlebar.spec.ts

21 lines
896 B
TypeScript

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);
}
});