-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react): update search result has result counts for each entities that has result #2991
feat(react): update search result has result counts for each entities that has result #2991
Conversation
@@ -6,7 +6,7 @@ import { useGetUserQuery } from '../graphql/user.generated'; | |||
* Fetch a CorpUser object corresponding to the currently authenticated user. | |||
*/ | |||
export function useGetAuthenticatedUser() { | |||
const userUrn = Cookies.get(CLIENT_AUTH_COOKIE); | |||
const userUrn = process.env.JEST_WORKER_ID !== undefined ? 'urn:li:corpuser:1' : Cookies.get(CLIENT_AUTH_COOKIE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not include anything related to tests in this method- if you need to mock this it should be mocked in the test file itself.
<StyledNumberInTab>{` (${countFormatter( | ||
resultCounts[type] || 0, | ||
)})`}</StyledNumberInTab> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove the parentheses now that the text is gray
analytics.event({ | ||
type: EventType.SearchResultsViewEvent, | ||
query, | ||
total: resultCount, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move the analytics event into its own useEffect- it is a bit confusing that this is a side effect of the use memo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Checklist