Skip to content
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

test: Create unit tests for react components in packages/ui/components/alert (tests-alert-component) #9897

Merged
merged 14 commits into from
Jul 19, 2023

Conversation

gitstart-calcom
Copy link
Contributor

@gitstart-calcom gitstart-calcom commented Jul 3, 2023

Here is the GitStart Ticket for this pull request: feat:tests-alert-component

What does this PR do?

This PR is part of a larger task, with the objective of creating unit tests for components present in the packages/ui/components/ folder. In addition, in this PR we are setting up the vitest for this folder, to be used in the next PRs

Demo

250400577-92218568-6b9b-404f-849b-45d492e3bf81

@vercel
Copy link

vercel bot commented Jul 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 3:29pm
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 3:29pm
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 3:29pm
cal-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 3:29pm
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 3:29pm
web-staging 🔄 Building (Inspect) Mar 19, 2024 3:29pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
dev ⬜️ Ignored (Inspect) Mar 19, 2024 3:29pm
qa ⬜️ Ignored (Inspect) Mar 19, 2024 3:29pm

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

Thank you for following the naming conventions! 🙏

@gitstart-calcom gitstart-calcom marked this pull request as ready for review July 3, 2023 13:37
@gitstart-calcom gitstart-calcom changed the title chore: Create unit tests for react components in packages/ui/components/alert (tests-alert-component) feat(tests): Create unit tests for react components in packages/ui/components/alert (tests-alert-component) Jul 3, 2023
@socket-security
Copy link

socket-security bot commented Jul 3, 2023

No top level dependency changes detected. Learn more about Socket for GitHub ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@deploysentinel
Copy link

deploysentinel bot commented Jul 3, 2023

Current Playwright Test Results Summary

✅ 71 Passing - ⚠️ 3 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 07/19/2023 12:00:11pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: b3c89f4

Started: 07/19/2023 11:56:34am UTC

⚠️ Flakes

📄   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 cancel the recently created booking and rebook the same timeslot
Retry 1Initial Attempt
0% (0) 0 / 307 runs
failed over last 7 days
2.61% (8) 8 / 307 runs
flaked over last 7 days

📄   apps/web/playwright/reschedule.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Reschedule Tests Should display former time when rescheduling availability
Retry 1Initial Attempt
0.32% (1) 1 / 309 run
failed over last 7 days
2.91% (9) 9 / 309 runs
flaked 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 Pending payment booking should not be confirmed by default
Retry 1Initial Attempt
1.28% (4) 4 / 313 runs
failed over last 7 days
9.90% (31) 31 / 313 runs
flaked over last 7 days

View Detailed Build Results


@PeerRich PeerRich changed the title feat(tests): Create unit tests for react components in packages/ui/components/alert (tests-alert-component) tests: Create unit tests for react components in packages/ui/components/alert (tests-alert-component) Jul 3, 2023
@Udit-takkar Udit-takkar changed the title tests: Create unit tests for react components in packages/ui/components/alert (tests-alert-component) test: Create unit tests for react components in packages/ui/components/alert (tests-alert-component) Jul 3, 2023
@@ -77,6 +77,7 @@
"@deploysentinel/playwright": "^0.3.3",
"@playwright/test": "^1.31.2",
"@snaplet/copycat": "^0.3.0",
"@testing-library/jest-dom": "^5.16.5",
Copy link
Member

Choose a reason for hiding this comment

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

why are we adding a new testing library? We already have playwright

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @PeerRich! We are using vitest to make the tests (a lib already installed on the project), we are just using the RTL to render the components. We can try to use only playwright for it but this lib is used to test pages instead only specifc components, but this can be more complicated

@PeerRich PeerRich added Low priority Created by Linear-GitHub Sync by: cal.com labels Jul 5, 2023
@alwaysmeticulous
Copy link

alwaysmeticulous bot commented Jul 12, 2023

🤖 Meticulous spotted visual differences in 33 of 169 screens tested: view and approve differences detected.

Last updated for commit b3c89f4. This comment will update as new commits are pushed.

@keithwillcode keithwillcode requested a review from a team July 14, 2023 14:16
Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Overall, I like these since they test the inner logic around severity controlling what is rendered.

In regards to asserting specific classes though, I'm in favor of not adding tests like those due to the brittle nature it brings to the test.

@gitstart-calcom
Copy link
Contributor Author

Hi @keithwillcode we made the requested changes now, thanks for the feedback! 😄

@keithwillcode keithwillcode merged commit bd7eadd into main Jul 19, 2023
@keithwillcode keithwillcode deleted the tests-alert-component branch July 19, 2023 15:22
fritterhoff pushed a commit to hm-edu/cal.com that referenced this pull request Jul 25, 2023
…s/alert (tests-alert-component) (calcom#9897)

Co-authored-by: gitstart-calcom <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only Low priority Created by Linear-GitHub Sync
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants