Skip to content

refactor: Refactor seats logic#12905

Merged
joeauyeung merged 105 commits into
mainfrom
refactor-seats-logic
Jan 15, 2024
Merged

refactor: Refactor seats logic#12905
joeauyeung merged 105 commits into
mainfrom
refactor-seats-logic

Conversation

@joeauyeung
Copy link
Copy Markdown
Contributor

@joeauyeung joeauyeung commented Dec 20, 2023

Stacked on #12062

What does this PR do?

  • Refactors handleSeats logic into separate files and into a new folder structure
    image
  • Adds unit tests for these logic blocks, replacing some E2E tests. Testing goes from 6mins down to 19 seconds

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is ab UI/UX design document, please, share it here.

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)
  • Tests (Unit/Integration/E2E or any other test)

How should this be tested?

  • Run booking seats E2E and unit tests

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't checked if new and existing unit tests pass locally with my changes

joeauyeung and others added 30 commits October 17, 2023 21:53
@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Jan 15, 2024

Current Playwright Test Results Summary

✅ 80 Passing - ⚠️ 2 Flaky

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

(Last updated on 01/15/2024 10:00:44pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 17ca289

Started: 01/15/2024 09:55:13pm UTC

⚠️ Flakes

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Long Text Question and Each Other Question Long Text required and Number not required
Retry 1Initial Attempt
0.25% (1) 1 / 394 run
failed over last 7 days
2.28% (9) 9 / 394 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Address Question and Each Other Question Booking With Address Question and Short text question Address required and Short text required
Retry 1Initial Attempt
0.50% (2) 2 / 403 runs
failed over last 7 days
3.72% (15) 15 / 403 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Copy Markdown
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

After type errors are fixed, I can approve 👍

EDIT: There are failing unit and e2e tests as well which might be related to the changes (https://github.com/calcom/cal.com/pull/12905/files#r1443076439)

Comment thread packages/features/bookings/lib/handleSeats/types.d.ts
Comment thread packages/features/bookings/lib/handleSeats/reschedule/rescheduleSeatedBooking.ts Outdated
joeauyeung and others added 4 commits January 15, 2024 15:28
* chore: add error message for no default user availability

* chore: check only availability

* chore: change message

* chore: add eventType
Copy link
Copy Markdown
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

Great work @joeauyeung 👏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only Medium priority Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants