Skip to content

Commit db90f22

Browse files
committed
[meta] Test getTitlebarIconSize()
1 parent 68dcbd5 commit db90f22

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/windows.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,31 @@ test.describe('$Window Component', () => {
543543
});
544544
});
545545

546+
test.describe('getTitlebarIconSize()', () => {
547+
test('should return the icon size used in the titlebar', async ({ page }) => {
548+
const h$window = await page.evaluateHandle(() => {
549+
const $window = $Window({
550+
title: 'Test Window',
551+
icons: {
552+
16: new Text('16x16 placeholder'),
553+
32: new Text('32x32 placeholder'),
554+
any: new Text('any size placeholder'),
555+
},
556+
});
557+
return $window;
558+
});
559+
expect(await h$window.evaluate(($window) =>
560+
$window.getTitlebarIconSize()
561+
)).toBe(16);
562+
await h$window.evaluate(($window) => {
563+
$window.setTitlebarIconSize(48);
564+
});
565+
expect(await h$window.evaluate(($window) =>
566+
$window.getTitlebarIconSize()
567+
)).toBe(48);
568+
});
569+
});
570+
546571
test.describe('setMenuBar()', () => {
547572
test('should add menu bar, which is hidden when minimized', async ({ page }) => {
548573
const h$window = await page.evaluateHandle(() => {

0 commit comments

Comments
 (0)