test: Create unit tests for react components in packages/ui/components/form/select#10459
test: Create unit tests for react components in packages/ui/components/form/select#10459keithwillcode merged 7 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
|
Thank you for following the naming conventions! 🙏 |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 122 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 08/25/2023 12:18:06pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 4993e43 Started: 08/25/2023 12:07:57pm UTC
|
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Event Types tests user Different Locations Tests can add Attendee Phone Number location and book with it
Retry 2 • Retry 1 • Initial Attempt |
0% (0)0 / 27 runsfailed over last 7 days |
7.41% (2)2 / 27 runsflaked over last 7 days |
📄 apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Stripe integration Paid booking should be able to be cancelled
Retry 1 • Initial Attempt |
0% (0)0 / 178 runsfailed over last 7 days |
5.06% (9)9 / 178 runsflaked over last 7 days |
📄 apps/web/playwright/booking-pages.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
pro user can reschedule a booking
Retry 1 • Initial Attempt |
0.38% (1)1 / 261 runfailed over last 7 days |
9.96% (26)26 / 261 runsflaked over last 7 days |
📄 apps/web/playwright/webhook.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
FORM_SUBMITTED can submit a form and get a submission event
Retry 1 • Initial Attempt |
1.15% (3)3 / 261 runsfailed over last 7 days |
22.99% (60)60 / 261 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Popup Tests should be able to reschedule
Retry 1 • Initial Attempt |
0.75% (2)2 / 265 runsfailed over last 7 days |
98.87% (262)262 / 265 runsflaked over last 7 days |
|
🤖 Meticulous spotted visual differences in 52 of 123 screens tested: view and approve differences detected. Last updated for commit 5a30b44. This comment will update as new commits are pushed. |
| await selectOption("Option 2"); | ||
| }); | ||
|
|
||
| expect(onChangeMock).toHaveBeenCalled(); |
There was a problem hiding this comment.
Would be best to test the callback args as well.
|
|
||
| expect(screen.getByRole("form")).toHaveFormValues({ test: "option2" }); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
We don't seem to be testing the code that we have written in Select component.
In the component, we are just configuring the props for react-select, so that's what we should be testing more I think.
- We need a test for verifying that any classes passed to Select are passed to ReactSelect
- We might need to test certain classes as well. It isn't recommended to test implementation details so may be we keep a color map for tests and verify the background color of the DOM element is CAL_BG_SUBTLE when isDisabled prop is given.
- Similarly we should probably test the result of passing all these props - isFocussed, isDisabled, isSelected. It might be overkill as well
| }); | ||
| }); | ||
|
|
||
| describe("Tests for SelectWithValidation component", () => { |
There was a problem hiding this comment.
It should atleast have one test that actually tests for validation failure.
hariombalhara
left a comment
There was a problem hiding this comment.
Thanks @gitstart. Left some comments.
|
Hello @hariombalhara |
Requested changes were implemented
Run