Fix CI: repair vitest test suite (inherited from upstream)#2
Merged
Conversation
loadConfigFromLocalStorage parsed `localStorage.getItem(type) ?? ''`,
but `JSON.parse('')` throws "Unexpected end of JSON input" instead of
yielding null — so a missing slot crashed SettingsService construction
(e.g. first run with empty storage) rather than falling through to the
defaults the next line already handles. Use `?? 'null'`, matching the
sibling pattern at line 744.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b95f441 to
13baafb
Compare
The karma->vitest migration left several specs red (upstream CI is red too). Fixes, none of which change app behaviour: - SettingsServiceStub (test.ts): add the path-validation / widget-history / night-mode / split-shell-swipe setters the real service gained. - widget.service.spec: assert the electrical widgets actually registered (solar-charger, charger); alternator/inverter/ac are commented out in widget.service.ts pending readiness. - login.component.spec: mock MatDialog so the credential dialog's afterClosed() resolves instead of throwing. - display.component.spec: add get/setDisablePathValidation to the local SettingsServiceMock. - path-control-config.spec: give the SignalKConnectionService mock a serverServiceEndpoint$ so AuthenticationService construction can subscribe without crashing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
13baafb to
8c718a1
Compare
This was referenced Jul 1, 2026
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.
Why
CI on the fork is red. Investigation shows the failures are inherited from upstream (mxtommy/kip's own master CI is red since ~2026-05-13) — the karma→vitest migration left the suite broken. None are caused by the fork, the rebrand, or the logo.
Root causes & fixes
SettingsService.loadConfigFromLocalStoragedidJSON.parse(localStorage.getItem(type) ?? '');JSON.parse('')throws instead of yieldingnull, so an empty/missing config slot crashedSettingsServiceconstruction (cascading into ~16 "should create" failures, and affecting real first-run users). Fixed →?? 'null', matching the sibling at line 744. Upstreamable.SettingsServiceStub(test.ts) lacked methods the real service gained (get/setDisablePathValidation,get/setWidgetHistoryDisabled,setNightModeBrightness,setSplitShellSwipeDisabled) → display & path-control specs hit "is not a function". Added them.widget-inverter/-alternator/-ac, which are commented out inwidget.service.ts. Aligned the test to the registered set (solar-charger, charger).ngOnInitopens a credential dialog; with noMatDialogmock,afterClosed()was undefined. MockedMatDialog.None of these change application behaviour (except fix 1, which is a genuine robustness fix).
Verification
Local env can't reproduce CI (its jsdom lacks
localStoragedue to a lockfile-drift version mismatch), so CI is the oracle — see the checks on this PR.🤖 Generated with Claude Code