-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: Show tests tab for public repos without a user being logged in #3200
Conversation
Bundle ReportChanges will increase total bundle size by 3.13kB ⬆️
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3200 +/- ##
=======================================
Coverage 98.15% 98.15%
=======================================
Files 930 932 +2
Lines 14456 14478 +22
Branches 3950 3875 -75
=======================================
+ Hits 14189 14211 +22
Misses 262 262
Partials 5 5
... and 4 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3200 +/- ##
=======================================
Coverage 98.15% 98.15%
=======================================
Files 930 932 +2
Lines 14456 14478 +22
Branches 3923 3956 +33
=======================================
+ Hits 14189 14211 +22
Misses 262 262
Partials 5 5
... and 4 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Bundle ReportChanges will increase total bundle size by 3.13kB (0.05%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #3200 +/- ##
===========================================
Coverage 98.15000 98.15000
===========================================
Files 930 932 +2
Lines 14456 14478 +22
Branches 3955 3956 +1
===========================================
+ Hits 14189 14211 +22
Misses 262 262
Partials 5 5
... and 4 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3200 +/- ##
=======================================
Coverage 98.15% 98.15%
=======================================
Files 930 932 +2
Lines 14456 14478 +22
Branches 3869 3875 +6
=======================================
+ Hits 14189 14211 +22
Misses 262 262
Partials 5 5
... and 4 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
src/pages/RepoPage/RepoPage.tsx
Outdated
@@ -310,6 +316,7 @@ function RepoPage() { | |||
isRepoPrivate={isRepoPrivate} | |||
isCurrentUserActivated={isCurrentUserActivated} | |||
testAnalyticsEnabled={repoOverview?.testAnalyticsEnabled} | |||
isCurrentUserPartOfOrg={repoData?.isCurrentUserPartOfOrg || false} |
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.
do we need the || false check here? if repoData?.isCurrentUserPartOfOrg is undefined it'll still be a falsey value
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.
yes if we want to explicitly set it to boolean, it's the pattern used in this component (see isRepoActivated, isRepoActive)
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.
Ah okay makes sense! Only thing I'd say then if we're looking for a boolean is we can utilize the !! syntax to cast a variable to its boolean equivalent
But that's a nit if anything
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.
sure thing!
@@ -98,11 +98,18 @@ export const useRepoTabs = ({ refetchEnabled }: UseRepoTabsArgs) => { | |||
}) | |||
} | |||
|
|||
if (isCurrentUserPartOfOrg) { | |||
if (repoOverview?.testAnalyticsEnabled) { |
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.
Nice catch!
] | ||
|
||
await waitFor(() => | ||
expect(result.current).not.toEqual( |
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.
Should we put what is expected here rather than .not() and have the variable name "expectedTab?" Would reduce cognitive burden here imo
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.
Sure i will add that as part of the test.
I'm specifically checking for the tab's existence because if analytics isn't enabled, it shouldn't appear—unless it's the specific case being tested. It's a bit more unique to this scenario.
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.
Also nice catch for the variable name!
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.
looks good!
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Description
As long as
Show the tab even if a user is not logged in (icognito mode etc).
Notable Changes
Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.