Skip to content

test: add Dexie CRUD tests for history.ts - #2331

Merged
felladrin merged 3 commits into
mainfrom
test/history-dexie-crud
Aug 10, 2026
Merged

test: add Dexie CRUD tests for history.ts#2331
felladrin merged 3 commits into
mainfrom
test/history-dexie-crud

Conversation

@felladrin

@felladrin felladrin commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Root cause

client/modules/history.ts had no test coverage for the Dexie CRUD functions (addSearchToHistory, getRecentSearches, updateSearchResults, saveLlmResponseForQuery, getLatestLlmResponseForEntry, saveChatMessageForQuery, getChatMessagesForQuery). Only search-run-ID helpers and pure helper functions were covered.

What changed

File Change
client/modules/history.test.ts Added 16 new tests covering all Dexie CRUD operations using fake-indexeddb in jsdom. Mocked ./pubSub so the cleanup hook does not fail on missing settings.

How it was verified

npx vitest run client/modules/history.test.ts  # 31 tests passed
npx vitest run                                  # 376 tests passed
npm run lint                                    # 0 errors

@felladrin
felladrin marked this pull request as ready for review August 10, 2026 21:54
@felladrin felladrin changed the title test: add Dexie CRUD tests for history.ts (#2168) test: add Dexie CRUD tests for history.ts Aug 10, 2026
@felladrin
felladrin merged commit 7070754 into main Aug 10, 2026
7 checks passed
@felladrin
felladrin deleted the test/history-dexie-crud branch August 10, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for history.ts (Dexie CRUD)

1 participant