Skip to content

The agent that grows with you

test(desktop): trim overlapping preview-dismissal cases

kshitijk4poord28762d88d38
diff --git a/apps/desktop/src/store/preview-status-lifecycle.test.ts b/apps/desktop/src/store/preview-status-lifecycle.test.ts
index a482a72033a..8979f02077c 100644
--- a/apps/desktop/src/store/preview-status-lifecycle.test.ts
+++ b/apps/desktop/src/store/preview-status-lifecycle.test.ts
@@ -37,7 +37,7 @@ it('moves local dismissals on rename and removes only the deleted owner', () =>
expect($previewStatusBySession.get()['rename-remote']).toBeUndefined()
})
-it('honors memory-only closes on storage failure and durable closes after module reload', async () => {
+it('keeps a close effective in memory when storage writes fail', () => {
recordSessionEventScope({ session_id: 'quota', connectionId: 'local', profile: 'quota' })
recordPreviewArtifact('quota', '/work/quota.html', '/work', 'quota-stored')
@@ -50,7 +50,9 @@ it('honors memory-only closes on storage failure and durable closes after module
recordPreviewArtifact('quota', '/work/quota.html', '/work', 'quota-stored')
expect($previewStatusBySession.get().quota).toBeUndefined()
write.mockRestore()
+})
+it('honors a durable close after module reload', async () => {
recordSessionEventScope({ session_id: 'before-reload', connectionId: 'local', profile: 'persist' })
recordPreviewArtifact('before-reload', '/work/saved.html', '/work', 'persist-stored')
dismissPreviewArtifact('before-reload', '/work/saved.html', 'persist-stored')
diff --git a/apps/desktop/src/store/preview-status.test.ts b/apps/desktop/src/store/preview-status.test.ts
index 41c76228992..97adc0858a1 100644
--- a/apps/desktop/src/store/preview-status.test.ts
+++ b/apps/desktop/src/store/preview-status.test.ts
@@ -45,21 +45,6 @@ describe('recordPreviewArtifact', () => {
expect($previewStatusBySession.get().s1).toBeUndefined()
})
- it('suppresses a dismissed historical target when the row mounts again', () => {
- for (const session_id of ['runtime-a', 'runtime-b']) {
- recordSessionEventScope({ session_id, connectionId: 'owner', profile: 'default' })
- }
-
- recordPreviewArtifact('runtime-a', '/a/index.html', '/work', 'stored-a')
- dismissPreviewArtifact('runtime-a', '/a/index.html', 'stored-a')
- $previewStatusBySession.set({})
-
- recordPreviewArtifact('runtime-b', '/a/index.html', '/work', 'stored-a')
-
- expect($previewStatusBySession.get()['runtime-b']).toBeUndefined()
- expect(window.localStorage.getItem('hermes.desktop.previewDismissals.v1')).toContain('stored-a')
- })
-
it('keeps dismissal with the session owner across foreground changes and runtime rebinds', () => {
const record = (runtime: string, connectionId: string, profile: string) => {
recordSessionEventScope({ session_id: runtime, connectionId, profile })