mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Test the rails' new layout and translate the edge switch
CCTV and Context take the full right column when open, so the hysteresis tests use a content-sized panel, and a test covers the full-height rule. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
d0b614d88e
commit
c54ead9432
16 files changed
+187
-53
No files matched your search
@@ -456,13 +456,17 @@ test('natural height includes visible content, margins and wrapper chrome, exclu
|
||||
// Outside measurement, CCTV is 391 px in focus and 629 px in normal mode;
|
||||
// Removing only the allocation leaves focus CSS active: its next reading is
|
||||
// 422 px, so the old decision exits focus and then re-enters on the 629 px read.
|
||||
function thrashingRightRail({ focused = false, weatherOpen = false } = {}) {
|
||||
function thrashingRightRail({
|
||||
focused = false,
|
||||
weatherOpen = false,
|
||||
tallId = 'cctv-panel',
|
||||
} = {}) {
|
||||
const f = fixture('right');
|
||||
f.options.windowRef.innerHeight = 920;
|
||||
f.options.leftStack.rect.top = 439.6;
|
||||
f.stack.computed.rowGap = '8px';
|
||||
const display = element('pp-toggles', { collapsed: true });
|
||||
const cctv = element('cctv-panel', { height: 629 });
|
||||
const cctv = element(tallId, { height: 629 });
|
||||
const weather = element('weather-panel', {
|
||||
height: 444,
|
||||
collapsed: !weatherOpen,
|
||||
@@ -533,8 +537,10 @@ for (const focused of [false, true]) {
|
||||
});
|
||||
}
|
||||
|
||||
// The hysteresis applies to panels that size to their content; CCTV and
|
||||
// Context take the column's full height whenever they are open.
|
||||
test('right rail keeps focus through 30 px content growth inside the hysteresis band', () => {
|
||||
const f = thrashingRightRail();
|
||||
const f = thrashingRightRail({ tallId: 'news-panel' });
|
||||
f.run();
|
||||
// Header + gap contribute 52 px: need moves 420 -> 450 -> 420.
|
||||
for (const height of [368, 398, 368, 398, 368]) {
|
||||
@@ -551,7 +557,7 @@ test('right rail keeps focus through 30 px content growth inside the hysteresis
|
||||
});
|
||||
|
||||
test('right rail enters focus only above available height and leaves below the full deadband', () => {
|
||||
const f = thrashingRightRail();
|
||||
const f = thrashingRightRail({ tallId: 'news-panel' });
|
||||
f.options.windowRef.innerHeight = 1000;
|
||||
f.options.leftStack.rect.top = 500;
|
||||
f.cctv.intrinsicHeight = 408; // Need equals available (460 px).
|
||||
@@ -568,6 +574,16 @@ test('right rail enters focus only above available height and leaves below the f
|
||||
assert.equal(f.stack.classList.contains('layout-focus'), false);
|
||||
});
|
||||
|
||||
test('an open CCTV panel takes the full column however short its content', () => {
|
||||
const f = thrashingRightRail();
|
||||
f.cctv.intrinsicHeight = 200;
|
||||
f.run();
|
||||
assert.equal(f.stack.classList.contains('layout-focus'), true);
|
||||
f.cctv.classList.add('collapsed');
|
||||
f.run();
|
||||
assert.equal(f.stack.classList.contains('layout-focus'), false);
|
||||
});
|
||||
|
||||
test('right rail settles a second tall panel through the accordion in one pass', () => {
|
||||
const f = thrashingRightRail({ weatherOpen: true });
|
||||
const modes = [];
|
||||
|
||||
Reference in new issue
Block a user