Skip to content

Conversation

@malwilley
Copy link
Member

  • Fixes a bug I was encountering due to GroupStore
  • Gets us a tiny bit closer to removing GroupStore
  • GroupList responses are now cached
  • Testing components with GroupList is simpler now since you don't need to specify the URL params in the mock

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 5, 2026
it('renders custom error when query has boolean logic', async () => {
const renderErrorMessage = jest.fn(() => <div>custom error</div>);
const issuesRequest = MockApiClient.addMockResponse({
url: `${issuesUrl}?${qs.stringify({...defaultQueryParams, query: 'issue.id:1'})}`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the file changes here are simplifying the mocks.

/organizations/org-slug/issues/?query=foo&cursor=bar -> /organizations/org-slug/issues/

* If you have access to the group data, it is preferred to pass it in as a prop here.
* Otherwise, the group data will come from the deprecated GroupStore.
*/
group?: Group;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to modify StreamGroup since it was looking directly at the store. This prop will help us get off of GroupStore if we add it to all the existing usages

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really good call, I wish there was a way in TS to mark it as 'will-be-required-in-the-future', or 'deprecated-to-omit'

@malwilley malwilley marked this pull request as ready for review January 5, 2026 23:37
@malwilley malwilley requested review from a team as code owners January 5, 2026 23:37
@malwilley malwilley requested review from a team and removed request for a team January 5, 2026 23:37
query: 'error.unhandled:true is:unresolved',
}),
})
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test assertion verifies wrong query after clicking "New Issues"

The test clicks on "New Issues" segment but then asserts that the API was called with query: 'error.unhandled:true is:unresolved', which is the IssuesQuery.UNHANDLED value. After clicking "New Issues", the expected query should be 'is:unresolved is:for_review' (IssuesQuery.NEW). Since toHaveBeenCalledWith checks if any call matched, this assertion passes due to the initial render (which uses UNHANDLED by default), not because clicking "New Issues" actually works. The test doesn't verify the intended behavior.

Fix in Cursor Fix in Web

@scttcper
Copy link
Member

scttcper commented Jan 6, 2026

note: we talked about how assignee selector would work in person. Worth double checking that assignee isn't putting that into only group store.

* If you have access to the group data, it is preferred to pass it in as a prop here.
* Otherwise, the group data will come from the deprecated GroupStore.
*/
group?: Group;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really good call, I wish there was a way in TS to mark it as 'will-be-required-in-the-future', or 'deprecated-to-omit'

});

beforeEach(() => {
// NOTE: This mock is jank. `GroupList` concatenates the query string with the URL. This means we have to mock the full URL including the parameters. There are a few other tests that have to do the same.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@malwilley malwilley merged commit 1ec040d into master Jan 8, 2026
53 checks passed
@malwilley malwilley deleted the malwilley/ref/grouplist-useapiquery branch January 8, 2026 17:36
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants