test: add comprehensive Vitest test suite (123 tests, 0 → full coverage of pure modules)#63
Draft
test: add comprehensive Vitest test suite (123 tests, 0 → full coverage of pure modules)#63
Conversation
…files Agent-Logs-Url: https://github.com/FirmwareDroid/FMD-WebClient/sessions/7967cd53-e804-4b79-8192-8b1cdf51a6db Co-authored-by: 7homasSutter <9306853+7homasSutter@users.noreply.github.com>
…be label Agent-Logs-Url: https://github.com/FirmwareDroid/FMD-WebClient/sessions/7967cd53-e804-4b79-8192-8b1cdf51a6db Co-authored-by: 7homasSutter <9306853+7homasSutter@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
7homasSutter
April 9, 2026 11:48
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The codebase had zero tests and no test infrastructure. This adds Vitest as the test framework and covers all testable pure modules — stores, utilities, hooks, and services.
Infrastructure
jsdomenvironment configured invite.config.ts@testing-library/react+@testing-library/jest-domfor hook teststest,test:watch,test:coveragesrc/test/setup.tsbootstraps jest-dom matchers globallyTest coverage added (11 files, 123 tests)
lib/utils.tscn()— merging, deduplication, conditionalsstores/toast.tsstores/adb.tsstores/file.tsservices/.../storage.tscookie > session > localpriority, jsdom integrationservices/.../credentials.tsservices/.../http-client.tssetBackendBaseUrl(protocol conversion, credential extraction, URL validation),setAuthTokenutils/file.jsgetFileSizeInMbinteger/fractional/large,getFileUrlutils/rules.jsutils/mapClientToDevicePosition.jshooks/use-mobile.tsNotable test patterns
setState({})inbeforeEachto prevent cross-test pollutionDate.nowmocked with an incrementing counter so rapidadd()calls in the toast store produce unique IDsadbServiceandfileUploadServicefully mocked to isolate store logic from HTTP