mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
The entry now lives in changelog.d/1471-context-panel-cleanup.md with credit, as CONTRIBUTING asks, and CHANGELOG.md is back to main. CURRENT-STATE no longer lists a compact Radio power control and scopes the readability description to what Cyber keeps. The responsive glow comment no longer cites the removed Radio popover, and qa-radio's pick-buffer comment is back above settleRadioFrames. Four test fixtures stop stubbing the removed launcher sync, and PanelChrome drops the _syncRailPanelCollapseButton pass-through, wiring the layout controller straight to _syncPanelCollapseButton.
65 lines
1.8 KiB
JavaScript
65 lines
1.8 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { test } from 'node:test';
|
|
import { renderRadioState } from './radioPresentation.js';
|
|
|
|
function el() {
|
|
const attrs = new Map();
|
|
return {
|
|
textContent: '',
|
|
hidden: false,
|
|
disabled: false,
|
|
style: {},
|
|
dataset: {},
|
|
classList: { toggle() {}, add() {}, remove() {}, contains: () => false },
|
|
setAttribute: (k, v) => attrs.set(k, String(v)),
|
|
getAttribute: (k) => attrs.get(k),
|
|
attrs,
|
|
};
|
|
}
|
|
|
|
for (const lifecycleState of ['enabling', 'disabling']) {
|
|
test(`Radio render survives the ${lifecycleState} transition`, () => {
|
|
const prior = globalThis.document;
|
|
globalThis.document = { getElementById: () => null };
|
|
try {
|
|
const enable = el();
|
|
const ctx = {
|
|
destroyed: false,
|
|
_radioPanel: el(),
|
|
_radioEnableBtn: enable,
|
|
actions: {
|
|
getLifecycle: () => ({
|
|
lifecycleState,
|
|
enabled: lifecycleState === 'disabling',
|
|
uncertain: false,
|
|
}),
|
|
},
|
|
};
|
|
const state = {
|
|
enabled: false,
|
|
categories: [],
|
|
filteredCount: 0,
|
|
stationCount: 0,
|
|
audioState: 'idle',
|
|
};
|
|
try {
|
|
renderRadioState.call(ctx, state);
|
|
} catch (error) {
|
|
// Anything thrown after the transitional label is a different
|
|
// missing fixture field, not the bug under test.
|
|
assert.ok(
|
|
!(
|
|
error instanceof ReferenceError &&
|
|
/lifecycleLabel/.test(error.message)
|
|
),
|
|
`render threw: ${error.message}`,
|
|
);
|
|
}
|
|
assert.equal(enable.attrs.get('aria-busy'), 'true');
|
|
assert.equal(enable.textContent, lifecycleState.toUpperCase());
|
|
} finally {
|
|
globalThis.document = prior;
|
|
}
|
|
});
|
|
}
|