This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { wallboardPlacement, wallboardSlideIndex } from '../../src/wallboardLayout';
|
||||
|
||||
describe('wallboard viewport layout', () => {
|
||||
it('splits the default 19-row layout into two deterministic 1080p slides', () => {
|
||||
expect([0, 6, 12, 13, 18].map(wallboardSlideIndex)).toEqual([0, 0, 0, 1, 1]);
|
||||
});
|
||||
|
||||
it('keeps every widget inside the 24 by 13 slide grid', () => {
|
||||
expect(wallboardPlacement({ x: 23, y: 12, w: 12, h: 8 })).toEqual({ columnStart: 24, columnSpan: 1, rowStart: 13, rowSpan: 1 });
|
||||
expect(wallboardPlacement({ x: -4, y: 13, w: 0, h: 0 })).toEqual({ columnStart: 1, columnSpan: 1, rowStart: 1, rowSpan: 1 });
|
||||
});
|
||||
|
||||
it('uses safe defaults for malformed coordinates', () => {
|
||||
expect(wallboardSlideIndex('not-a-row')).toBe(0);
|
||||
expect(wallboardPlacement({ x: Number.POSITIVE_INFINITY, y: null, w: 'wide', h: -2 }))
|
||||
.toEqual({ columnStart: 1, columnSpan: 6, rowStart: 1, rowSpan: 1 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user