mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
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.
23 lines
981 B
JavaScript
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,
|
|
};
|
|
}
|