Add tests for the inventory string dropdown #513
No reviewers
Labels
No labels
blocked
duplicate
needs
approval
needs
criteria
needs
estimate
needs
tests
question
step
doing
step
review
step
testing
step
todo
step
uat
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
External/card-drop!513
Loading…
Reference in a new issue
No description provided.
Delete branch "cursor/487-inventory-dropdown-tests"
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?
Follow-up 1 of 3 from #487, split out as you asked on the issue.
Adds
tests/stringDropdowns/Inventory.test.ts, the last untested handler from the #487 coverage checklist.src/stringDropdowns/Inventory.tsis unchanged - this is test-only.Nine cases, covering every branch of
execute:members.fetchnot called,GenerateInventoryPagecalled with the parsed username / user id / page number, and the page sent viaeditReplywith the image, embed and both button rows.members.fetch(userid)and still renders.undefined: follows up with "No page for user found." and does noteditReply.The page-number assertion is the one with teeth: the handler splits
interaction.values[0]on a space and passesNumber(page), so the test pins both the parse and the string-to-number conversion.Verified locally on
release/0.12.0: new suite 9/9 passing,tsc --noEmitclean,eslintclean on the new file.Mocking follows the local-factory pattern used by the dispatcher suites in #512 rather than the shared
tests/__functions__generators, because there is noStringSelectMenuInteractiongenerator yet and adding one for a single suite felt like the wrong trade. Worth extracting if more dropdown suites appear.No overlap with #512 - that PR does not touch
src/stringDropdowns/Inventory.tsor this test path, so the two can merge in either order.