Repository navigation
test(agent): pin the new-tab suggestions - useSuggestions, getSuggestionLabel (Closes #1633) - #1931
Merged
Merged
Conversation
β¦ionLabel (Closes #1633)
Summary by t27-beesThis PR adds a contract test file pinning the current behavior of Worth a look
Read: 1 files, +153 -0, the whole diff. Head |
β Tests passed β 3546/3616
|
Collaborator
Author
|
CI gates on this SHA:
Dmitrii Fedorov (@dmitrii-f-t27) |
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.
Closes #1633
What changed
One new file:
trios/agent-server/apps/agent/entrypoints/newtab/index/lib/suggestions/useSuggestions.test.ts(the path the issue's Success Criteria names). The subjectuseSuggestions.tsis untouched.The 2 exported symbols are exercised (2
it(blocks; 0 blocked):useSuggestions(1 test): the three suggestion sources are stubbed with full stand-ins steered by module-level fixtures, and the hook renders underrenderToStaticMarkupinside a probe that serialises the sections it builds - the composition itself is what the pins read: nothing without a query; the search section behind the real provider name with the raw query trimmed, the case-duplicate dropped and the blank entries gone (Google Search:hello world/second, two flat items); the AI actions section ahead of search when tabs are selected; and the BrowserOS answer first when it has something to say.getSuggestionLabel(1 test): the text each kind of suggestion shows - the search query, the AI action name, the BrowserOS message.No other suite of this job imports the stubbed modules (checked), and the subject is imported dynamically after the stand-ins register, so the file order cannot break the load. The provider lookup stays real - the pins read the section title it names.
How it was verified (FR-004)
2 pass / 0 fail / 10 expect() calls, Ran 2 tests across 1 file.1 pass / 1 fail / 7 expect() calls. The subject was restored byte-identical (git checkout;git diff --name-onlyprints nothing) and the suite passes again.bun run typecheckrunswxt prepare, whose generated.wxt/tsconfig.jsonmakes bun 1.3.6 stop resolving@/aliases for test runs until that generated directory is removed. CI's Tests jobs never runwxt prepare; every run quoted above is from a checkout without.wxt/.Not verified
Tests / agentjob re-runs the suite on this SHA.Dmitrii Fedorov (@dmitrii-f-t27)