-
Notifications
You must be signed in to change notification settings - Fork 14
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(KONFLUX-5886): allow unselecting default context #58
Conversation
Demo of the following:
konflux-5886.mp4 |
9d36d95
to
eb33e13
Compare
eb33e13
to
8c1f7d9
Compare
It appears that the code coverage step fails:
|
I met the same token problem for my ci jobs but after 2 days later, retry fixed the problem. It seems the ci is not very stable for this part. |
LGTM |
8c1f7d9
to
fcd4962
Compare
LGTM |
LGTM |
@@ -0,0 +1,17 @@ | |||
import { fireEvent, screen, act } from '@testing-library/react'; |
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.
move this file under __tests__
?
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.
File has been moved
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.
Summary of all failing tests
FAIL src/components/IntegrationTests/__tests__/test-utils.ts
● Test suite failed to run
Your test suite must contain at least one test.
at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
at node_modules/@jest/core/build/TestScheduler.js:254:19
at node_modules/emittery/index.js:363:13
at Array.map (<anonymous>)
at Emittery.emit (node_modules/emittery/index.js:361:23)
It looks like the test run failed because only tests are expected under __tests__
... would moving this back to utils
be fine? Or maybe __test-utils__
?
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.
@sahil143 I reverted the change to fix the unit test step from failing (see above). If you have any recommendations on where else I should move this besides __tests__
to prevent the failure again please let me know.
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.
My only concern is that the testing utilities should not be kept with the actual component utilities. I like the idea of creating separate utilities for opening dropdowns that can be used everywhere else. You can rename the functions to something more specific like openIntegrationTestContextDropown
and move them to the common test-utils in src/utils/test-utils.ts. I am open to any other suggestions.
9338d33
to
42c716f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
- Coverage 80.15% 80.09% -0.06%
==========================================
Files 569 570 +1
Lines 21391 21443 +52
Branches 5291 5307 +16
==========================================
+ Hits 17146 17175 +29
- Misses 4220 4244 +24
+ Partials 25 24 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Code patch check looks safe to ignore IMO. |
if (!contexts?.length) return []; | ||
const getFormContextValues = ( | ||
integrateTest: IntegrationTestScenarioKind | null | undefined, | ||
): FormContext[] => { |
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.
Adding unit tests for this utility should help with the codecoverage
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.
Good catch! Test added.
@@ -0,0 +1,17 @@ | |||
import { fireEvent, screen, act } from '@testing-library/react'; |
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.
My only concern is that the testing utilities should not be kept with the actual component utilities. I like the idea of creating separate utilities for opening dropdowns that can be used everywhere else. You can rename the functions to something more specific like openIntegrationTestContextDropown
and move them to the common test-utils in src/utils/test-utils.ts. I am open to any other suggestions.
f64d63d
to
5aecd12
Compare
@sahil143 That's fair. I moved the test utils to |
5aecd12
to
b06bc0f
Compare
The user should be able to unselect the default context during the creation of an integration test. Other changes: - Contexts are now required (at least one) Signed-off-by: Bryan Ramos <[email protected]>
b06bc0f
to
4611189
Compare
The user should be able to unselect the default context during the creation of an integration test.
Other changes: