Implement all 30 test.todo stubs across the test suite #502
No reviewers
Labels
No labels
blocked
duplicate
needs
approval
needs
criteria
needs
estimate
needs
tests
question
type
admin
type
alert
type
bug
type
change
type
defect
type
epic
type
idea
type
incident
type
investigation
type
spike
type
story
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
External/card-drop!502
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/add-tests-for-todos"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
30
test.todostubs existed across the codebase with no implementations, leaving core flows (drop lifecycle, claim, reroll, multidrop, timers, effect purchasing) without test coverage.Mock infrastructure
deferReplytoButtonInteractionmock type and generator (used byReroll)replyandoptions.gettoChatInputCommandInteractionmock type and generator (used by error paths andeffects/Buy)New test implementations
timers/PurgeClaims— verifiesFetchAll,RemoveManyreceives only claims older than 2 minutes, andLogInfois calledhelpers/DropEmbedHelper— verifiesGenerateDropButtonsreturns anActionRowBuilderwith 3ButtonBuildercomponentshelpers/EffectHelper—GenerateEffectBuyEmbed— covers invalid effect id, new user auto-creation, insufficient currency, success path, and disabled-button statecommands/effects/Buy— string error reply, embed/row reply, and quantity defaulting to1buttonEvents/Effects— routesbuyaction toBuy.Executecommands/drop— local file path (readFileSynccalled,filesarray populated), new user creation,RemoveCurrencyfailure reply, null card warn+reply, and inner try/catch error pathcommands/multidrop— local vs.http://vs.https://image hosting (file attachment vs. emptyfilesarray)buttonEvents/Reroll—RemoveCurrencycalled withClaimCost, user saved, insufficient currency replybuttonEvents/Multidrop— same local/http/https image hosting coverage for the Keep actionKey implementation notes
fsmust be mocked withjest.requireActualspread to preserve typeorm's native bindings:Tests using
beforeAllto run the SUT once must not pair with a file-levelbeforeEach(() => jest.resetAllMocks()), as that clears call records before assertions execute.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.