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

fix: Fix all TS warnings (fix-tsWarnings) #12139

Merged
merged 12 commits into from
Jan 4, 2024
Merged

fix: Fix all TS warnings (fix-tsWarnings) #12139

merged 12 commits into from
Jan 4, 2024

Conversation

gitstart-app[bot]
Copy link
Contributor

@gitstart-app gitstart-app bot commented Oct 30, 2023

HOW TO RUN THE TESTS

run yarn lint

@vercel
Copy link

vercel bot commented Oct 30, 2023

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 9:36am
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 9:36am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 9:36am
ui 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 9:36am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jan 2, 2024 9:36am
cal-demo ⬜️ Ignored (Inspect) Visit Preview Jan 2, 2024 9:36am
qa ⬜️ Ignored (Inspect) Visit Preview Jan 2, 2024 9:36am

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 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 Oct 30, 2023

Current Playwright Test Results Summary

✅ 336 Passing - ⚠️ 24 Flaky

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

(Last updated on 11/29/2023 01:37:58pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 8a904d3

Started: 11/29/2023 01:26:13pm UTC

⚠️ Flakes

📄   apps/web/playwright/booking/radioGroupQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Radio Question and Each Other Question Booking With Radio Question and Address Question Booking With Radio Question and Short text question Radio and Short text not required
Retry 1Initial Attempt
0.35% (1) 1 / 283 run
failed over last 7 days
0.35% (1) 1 / 283 run
flaked over last 7 days

📄   apps/web/playwright/locale.e2e.ts • 13 Flakes

Top 1 Common Error Messages

null

13 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
unauthorized user sees correct translations (de) should use correct translations and html attributes
Retry 1Initial Attempt
-56.14% (-160) -160 / 285 runs
failed over last 7 days
56.14% (160) 160 / 285 runs
flaked over last 7 days
unauthorized user sees correct translations (ar) should use correct translations and html attributes
Retry 1Initial Attempt
-56.14% (-160) -160 / 285 runs
failed over last 7 days
56.14% (160) 160 / 285 runs
flaked over last 7 days
unauthorized user sees correct translations (zh) should use correct translations and html attributes
Retry 1Initial Attempt
-56.14% (-160) -160 / 285 runs
failed over last 7 days
56.14% (160) 160 / 285 runs
flaked over last 7 days
unauthorized user sees correct translations (zh-CN) should use correct translations and html attributes
Retry 1Initial Attempt
-56.14% (-160) -160 / 285 runs
failed over last 7 days
56.14% (160) 160 / 285 runs
flaked over last 7 days
unauthorized user sees correct translations (zh-TW) should use correct translations and html attributes
Retry 1Initial Attempt
-56.14% (-160) -160 / 285 runs
failed over last 7 days
56.14% (160) 160 / 285 runs
flaked over last 7 days
unauthorized user sees correct translations (pt) should use correct translations and html attributes
Retry 1Initial Attempt
-56.14% (-160) -160 / 285 runs
failed over last 7 days
56.14% (160) 160 / 285 runs
flaked over last 7 days
unauthorized user sees correct translations (pt-br) should use correct translations and html attributes
Retry 1Initial Attempt
-56.14% (-160) -160 / 285 runs
failed over last 7 days
56.14% (160) 160 / 285 runs
flaked over last 7 days
unauthorized user sees correct translations (es-419) should use correct translations and html attributes
Retry 1Initial Attempt
-55.94% (-160) -160 / 286 runs
failed over last 7 days
55.94% (160) 160 / 286 runs
flaked over last 7 days
authorized user sees correct translations (de) should return correct translations and html attributes
Retry 1Initial Attempt
-54.58% (-155) -155 / 284 runs
failed over last 7 days
56.34% (160) 160 / 284 runs
flaked over last 7 days
authorized user sees correct translations (pt-br) should return correct translations and html attributes
Retry 1Initial Attempt
-55.56% (-155) -155 / 279 runs
failed over last 7 days
57.35% (160) 160 / 279 runs
flaked over last 7 days
authorized user sees correct translations (ar) should return correct translations and html attributes
Retry 1Initial Attempt
-57.66% (-158) -158 / 274 runs
failed over last 7 days
58.03% (159) 159 / 274 runs
flaked over last 7 days
authorized user sees changed translations (de->ar) should return correct translations and html attributes
Retry 1Initial Attempt
-18.32% (-50) -50 / 273 runs
failed over last 7 days
41.03% (112) 112 / 273 runs
flaked over last 7 days
authorized user sees changed translations (de->pt-BR) [locale1] should return correct translations and html attributes
Retry 1Initial Attempt
-22.27% (-47) -47 / 211 runs
failed over last 7 days
40.28% (85) 85 / 211 runs
flaked over last 7 days

📄   apps/web/playwright/booking/phoneQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Phone Question and Each Other Question Booking With Phone Question and Address Question Phone required and Address not required
Retry 1Initial Attempt
0.35% (1) 1 / 289 run
failed over last 7 days
2.77% (8) 8 / 289 runs
flaked over last 7 days

📄   apps/web/playwright/event-types.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests user -- future Different Locations Tests can add Attendee Phone Number location and book with it
Retry 2Retry 1Initial Attempt
0% (0) 0 / 242 runs
failed over last 7 days
8.68% (21) 21 / 242 runs
flaked over last 7 days
Event Types tests user -- legacy Different Locations Tests Can remove location from multiple locations that are saved
Retry 1Initial Attempt
0% (0) 0 / 242 runs
failed over last 7 days
2.89% (7) 7 / 242 runs
flaked over last 7 days

📄   apps/web/playwright/booking/multipleEmailQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Multiple Email Question and Each Other Question Booking With Multiple Email Question and Radio group Question Booking With Multiple Email Question and Short text question Multiple Email required and Short text required
Retry 1Initial Attempt
0% (0) 0 / 290 runs
failed over last 7 days
1.03% (3) 3 / 290 runs
flaked over last 7 days

📄   apps/web/playwright/organization/organization-creation.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization should be able to create an organization and complete onboarding
Retry 1Initial Attempt
2.73% (8) 8 / 293 runs
failed over last 7 days
94.54% (277) 277 / 293 runs
flaked over last 7 days

📄   apps/web/playwright/organization/organization-invitation.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization Invitation (non verified)
Retry 1Initial Attempt
10.62% (31) 31 / 292 runs
failed over last 7 days
21.23% (62) 62 / 292 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when no theme is configured through Embed API
Retry 1Initial Attempt
0.96% (3) 3 / 311 runs
failed over last 7 days
74.60% (232) 232 / 311 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
6.15% (19) 19 / 309 runs
failed over last 7 days
90.61% (280) 280 / 309 runs
flaked over last 7 days

📄   apps/web/playwright/team/team-invitation.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Team Invitation (non verified)
Retry 1Initial Attempt
2.57% (7) 7 / 272 runs
failed over last 7 days
16.54% (45) 45 / 272 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams - NonOrg Non admin team members cannot create team in org
Retry 1Initial Attempt
5.81% (18) 18 / 310 runs
failed over last 7 days
26.77% (83) 83 / 310 runs
flaked over last 7 days

View Detailed Build Results


@gitstart-calcom gitstart-calcom marked this pull request as ready for review October 30, 2023 02:23
@github-actions github-actions bot added the 🚨 merge conflict This PR has a merge conflict that has to be addressed label Oct 30, 2023
Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

It seems like production build is failing. Can we check why is that?

@gitstart-calcom
Copy link
Contributor

@zomars We updated the PR and now all checks are passing 😄

@@ -55,9 +53,7 @@ test.describe("Payment app", () => {
const user = await users.create();
await user.apiLogin();
const paymentEvent = user.eventTypes.find((item) => item.slug === "paid");
if (!paymentEvent) {
Copy link
Member

Choose a reason for hiding this comment

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

Since we're not type narrowing can we at least assert paymentEvent! as not null? To avoid using paymentEvent?. everywhere

Copy link
Contributor

@gitstart-calcom gitstart-calcom Nov 29, 2023

Choose a reason for hiding this comment

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

Hi @zomars, We are asserting about that with the change on line 56
image

We added it in all cases, if we remove the "?"we would have to use a "!" on paymentEvent const to make sure is not undefined. We can add it and disable ts for that case

Like here:

image

Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Dec 15, 2023
Copy link
Contributor

This PR is being closed due to inactivity. Please reopen if work is intended to be continued.

@github-actions github-actions bot closed this Dec 23, 2023
@github-actions github-actions bot removed the Stale label Dec 31, 2023
Comment on lines -401 to -415
const getStripeCurrency = (stripeMetadata: { currency: string }, credentials: Credential[]) => {
// Favor the currency from the metadata as EventType.currency was not always set and should be deprecated
if (stripeMetadata.currency) {
return stripeMetadata.currency;
}

// Legacy support for EventType.currency
const stripeCredential = credentials.find((integration) => integration.type === "stripe_payment");
if (stripeCredential) {
return (stripeCredential.key as unknown as StripeData)?.default_currency || "usd";
}

// Fallback to USD but should not happen
return "usd";
};
Copy link
Member

Choose a reason for hiding this comment

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

Is this removal intended?

Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

LGTM !

@zomars zomars merged commit 6a13258 into main Jan 4, 2024
24 checks passed
@zomars zomars deleted the fix-tsWarnings branch January 4, 2024 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated-tests area: unit tests, e2e tests, playwright Low priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants