Fix lint error and align daily-logs tests with refactored route - #17
Merged
Conversation
Co-authored-by: sharf-shawon <25235032+sharf-shawon@users.noreply.github.com> Agent-Logs-Url: https://github.com/sharf-shawon/FinanceFrz/sessions/126657c0-ec13-4f98-bafe-c5f6e697fa5f
Copilot
AI
changed the title
[WIP] Fix linting and add tests for 100% coverage
Fix lint error and align daily-logs tests with refactored route
Mar 25, 2026
sharf-shawon
marked this pull request as ready for review
March 25, 2026 23:54
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.
CI was failing due to one ESLint violation and 7 test failures introduced when the daily-logs API was refactored to use an internal auto-managed account instead of a user-supplied
accountId.Lint fix —
components/layout/dashboard-shell.tsxreact-hooks/set-state-in-effectflagged a synchronoussetTheme()call insideuseEffect. Replaced with a lazyuseStateinitializer:Test fixes —
__tests__/api/daily-logs.test.tsThe route now always resolves the account via
getOrCreateDailyLogsAccount()(account.findFirst→account.create). Tests were written against the old user-suppliedaccountIdmodel.mockAccountFindFirstsetup (required before thePromise.alldata fetch); removedmockAccountFindManycalls; dropped the stalejson.accountsexpectation (the route no longer returns anaccountsarray)accountIdis optional in the schema and ignored by the route — updated to assert the request succeeds without itgetOrCreatecreation path (addsmockAccountCreateto the mock graph and assertsaccount.createis called with the correctDaily Logspayload)README
Updated coverage badge and stats (100% stmts / 98.9% branches / 100% fns, 234 tests across 19 files), corrected coverage threshold (≥95%), and corrected Next.js version (16).
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.