mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-17 00:26:41 +03:00
Carry native comp capture and completion integrity fixes into the reviewed component workflow. Bump the skill to 4.4.0 and engine/platform pins to 0.1.6; keep publication separate from this release candidate. AI assistance: implemented and validated with OpenAI Codex.
14 lines
646 B
TypeScript
14 lines
646 B
TypeScript
import { expect, test } from 'bun:test';
|
|
import { comparisonSize } from './viewport';
|
|
|
|
test('portrait regions fit the available height without distorting the reference', () => {
|
|
const size = comparisonSize(768, 922, 210, 248, 'fit');
|
|
expect(size.height).toBe(248);
|
|
expect(size.width).toBeCloseTo(206.577, 2);
|
|
expect(size.width / size.height).toBeCloseTo(768 / 922);
|
|
});
|
|
test('zoom uses comp pixels, including tiny texture regions and thin controls', () => {
|
|
expect(comparisonSize(154, 102, 210, 248, 4)).toEqual({scale:4,width:616,height:408});
|
|
expect(comparisonSize(1440, 4, 210, 248, 1)).toEqual({scale:1,width:1440,height:4});
|
|
});
|