fix(properties): harden recovery and window chrome

This commit is contained in:
NimBold
2026-08-05 21:41:59 +03:30
parent c1202229ac
commit b36f55e5b5
16 changed files with 527 additions and 132 deletions
+12 -1
View File
@@ -1,5 +1,9 @@
import { describe, expect, it } from 'vitest';
import { getWindowControlRevealOffset, resolveWindowControlStyle } from './windowControlStyle';
import {
getWindowControlRevealOffset,
resolveWindowControlSide,
resolveWindowControlStyle,
} from './windowControlStyle';
describe('resolveWindowControlStyle', () => {
it('uses the platform convention for automatic style', () => {
@@ -32,4 +36,11 @@ describe('resolveWindowControlStyle', () => {
expect(getWindowControlRevealOffset('gnome')).toBe(134);
expect(getWindowControlRevealOffset('minimal')).toBe(104);
});
it('resolves automatic control placement from the effective document direction', () => {
expect(resolveWindowControlSide('auto', 'ltr')).toBe('left');
expect(resolveWindowControlSide('auto', 'rtl')).toBe('right');
expect(resolveWindowControlSide('left', 'rtl')).toBe('left');
expect(resolveWindowControlSide('right', 'ltr')).toBe('right');
});
});