mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 18:45:53 +00:00
Merge commit 'b90f2ee6e2cbc0d26e3405c7f1049b607dab8474'
Change-source: pulse-maintainer
This commit is contained in:
@@ -77,6 +77,7 @@ describe('useAppRuntimeState', () => {
|
||||
let websocketConnected: boolean;
|
||||
let websocketReconnecting: boolean;
|
||||
let websocketInitialDataReceived: boolean;
|
||||
let websocketResourceSnapshotReceived: boolean;
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
@@ -148,6 +149,7 @@ describe('useAppRuntimeState', () => {
|
||||
websocketConnected = false;
|
||||
websocketReconnecting = false;
|
||||
websocketInitialDataReceived = false;
|
||||
websocketResourceSnapshotReceived = false;
|
||||
|
||||
vi.doMock('@/stores/websocket-global', () => ({
|
||||
getGlobalWebSocketStore: () => ({
|
||||
@@ -155,7 +157,7 @@ describe('useAppRuntimeState', () => {
|
||||
connected: () => websocketConnected,
|
||||
reconnecting: () => websocketReconnecting,
|
||||
initialDataReceived: () => websocketInitialDataReceived,
|
||||
resourceSnapshotReceived: () => websocketInitialDataReceived,
|
||||
resourceSnapshotReceived: () => websocketResourceSnapshotReceived,
|
||||
reconnect: vi.fn(),
|
||||
switchUrl: vi.fn(),
|
||||
}),
|
||||
@@ -700,7 +702,8 @@ describe('useAppRuntimeState', () => {
|
||||
websocketState = makeWebSocketState({ activeAlerts: [{ id: 'recovered-alert' } as State['activeAlerts'][number]] });
|
||||
websocketConnected = false;
|
||||
websocketReconnecting = true;
|
||||
websocketInitialDataReceived = false;
|
||||
websocketInitialDataReceived = true;
|
||||
websocketResourceSnapshotReceived = false;
|
||||
const { hookState, dispose } = mountHook();
|
||||
await waitFor(() => expect(hookState.enhancedStore()).not.toBeNull());
|
||||
expect(hookState.state().activeAlerts).toHaveLength(1);
|
||||
@@ -708,6 +711,20 @@ describe('useAppRuntimeState', () => {
|
||||
dispose();
|
||||
});
|
||||
|
||||
it('retains explicit empty resource admission while transport hydration resets', async () => {
|
||||
websocketState = makeWebSocketState();
|
||||
websocketConnected = false;
|
||||
websocketReconnecting = true;
|
||||
websocketInitialDataReceived = false;
|
||||
websocketResourceSnapshotReceived = true;
|
||||
const { hookState, dispose } = mountHook();
|
||||
await waitFor(() => expect(hookState.enhancedStore()).not.toBeNull());
|
||||
expect(hookState.state().resources).toHaveLength(0);
|
||||
expect(hookState.enhancedStore()?.initialDataReceived()).toBe(false);
|
||||
expect(hookState.runtimeStateResolved()).toBe(true);
|
||||
dispose();
|
||||
});
|
||||
|
||||
it('distinguishes an evidence-free first load from an authenticated empty estate', async () => {
|
||||
// The distinction still matters: an estate with nothing in it must resolve
|
||||
// to "no platform pages", not sit unresolved forever. It is now answered by
|
||||
|
||||
@@ -40,3 +40,12 @@ binds this run to the release-line base and runtime source hashes.
|
||||
|
||||
Existing critical-transition and stable-identity recovery tests also passed
|
||||
three race repetitions on this base with the backport applied.
|
||||
|
||||
Follow-up hook coverage on 5 September separates the mocked resource-snapshot
|
||||
flag from general hydration. Alert-only hydration now explicitly reports
|
||||
initialDataReceived=true with resourceSnapshotReceived=false; the inverse case
|
||||
retains an authoritative empty resource snapshot during reconnect. All 88 tests
|
||||
in the three focused files above pass. Temporarily substituting
|
||||
initialDataReceived for resourceSnapshotReceived in runtimeStateResolved makes
|
||||
both boundary tests fail (two failures, 21 skipped); the mutation was removed.
|
||||
This verifies regression sensitivity, not installed browser or soak readiness.
|
||||
|
||||
Reference in New Issue
Block a user