Files
gods-eye-view/src/layers/awareness/testing.js
T
Sameh Khamis 1e4df63efe feat(ui): render the Contacts panel from the awareness layer's published view
The awareness layer presents its panel as a plain view and publishes it through subscribePanel() instead of writing markup into #military-awareness-panel. AwarenessPanel renders it from the gev-context store, calls the layer's navigation, and keeps focus on the same control by identity across live repaints, continuing at the note when that control leaves or is disabled.
2026-10-31 01:03:28 -07:00

23 lines
981 B
JavaScript

export function createTesting({ state: layerState, services, parts, source }) {
/** @returns {{historyKeys: string[], navigationVisitedKeys: string[], historyLength: number, navigationIndex: number, suppressedHistoryKey: string|null, pendingSelectionKey: string|null}} */
function _getAwarenessNavigationStateForTest() {
return {
historyKeys: layerState.navigationHistory.map(parts.subject.subjectKey),
navigationVisitedKeys: [...layerState.navigationVisited],
historyLength: layerState.navigationHistory.length,
navigationIndex: layerState.navigationIndex,
suppressedHistoryKey: layerState.suppressedHistoryKey,
pendingSelectionKey: layerState.pendingSelectionKey,
};
}
/** @returns {number} How many result renders ran, published or not. */
function _getAwarenessPanelRendersForTest() {
return layerState.panelRenders;
}
return {
_getAwarenessNavigationStateForTest,
_getAwarenessPanelRendersForTest,
};
}