Skip to content

test: add E2E tests for routing form attribute conditions#27681

Merged
hariombalhara merged 7 commits intomainfrom
devin/1770317005-routing-form-attribute-e2e
Feb 9, 2026
Merged

test: add E2E tests for routing form attribute conditions#27681
hariombalhara merged 7 commits intomainfrom
devin/1770317005-routing-form-attribute-e2e

Conversation

@joeauyeung
Copy link
Copy Markdown
Contributor

@joeauyeung joeauyeung commented Feb 5, 2026

What does this PR do?

Adds comprehensive E2E tests for routing forms with attribute conditions. Previously there were no E2E tests that set up a routing form with attributesQueryValue conditions and verified routing to a specific event type based on team member attributes.

The tests use database seeding via Prisma to create the full test fixture: org → sub-team → round-robin event type → attribute → attribute assignment → routing form with attribute condition routes. Each test submits the form via the route-builder preview UI and verifies routing with dual assertions: URL parameter check (cal.routedTeamMemberIds) and UI verification (organizer email in results).

This includes tests for exclusion operators with no attribute assigned (e.g. select_not_equals, multiselect_not_some_in, not_equal, not_like, not_between), which exercise the fix from #27669.

Coverage (35 E2E tests)

Attribute Type Operators Tested
SINGLE_SELECT select_equals (match + no-match), select_not_equals (match + no-match + no attribute assigned)
MULTI_SELECT multiselect_some_in (match + no-match), multiselect_not_some_in (match + no attribute assigned), multiselect_equals (match), multiselect_not_equals (match + no attribute assigned)
NUMBER equal (match + no-match), not_equal (match + no attribute assigned), less, less_or_equal, greater, greater_or_equal, between (match + no-match), not_between (match + no attribute assigned)
TEXT equal (match + no-match), not_equal (match + no attribute assigned), like, not_like (match + no attribute assigned), starts_with, is_empty (match when no assignment), is_not_empty
Fallback Verifies fallback route when no members match attribute logic

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A — E2E tests only, no production code changes.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Run the E2E tests locally:

PLAYWRIGHT_HEADLESS=1 yarn e2e --project=@calcom/app-store packages/app-store/routing-forms/playwright/tests/attribute-routing.e2e.ts

All 35 E2E tests should pass.

Human Review Checklist

⚠️ Please verify these items during review:

  1. RAQB JSON structure — The attributesQueryValue is manually constructed in setupTest(). Verify it matches the format the UI produces.

  2. "No attribute assigned" test expectations — These tests rely on the fix from fix: Exclusion attribute filter #27669 (_prepareAssignmentData iterating allTeamMemberIds). Verify the assertions are correct for each exclusion operator.

  3. is_empty behavior — Test expects is_empty to match users with no attribute assignment. Verify this is the correct product behavior.


Link to Devin run: https://app.devin.ai/sessions/7e4fb3908f5947428a65ff85af6e1476
Requested by: @joeauyeung

Checklist

  • I have read the contributing guide
  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings
  • My PR is appropriately sized (~689 lines, 1 new file)

Open with Devin

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 3 commits February 5, 2026 20:03
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
…on evaluation

Users with no attribute assigned were excluded from the team members list
entirely, causing exclusion operators (not_equals, not_some_in, not_like,
not_between, etc.) to never match them. Now getAttributesAssignmentData
includes all team members, even those without attribute assignments.

Also adds unit tests and E2E tests for this scenario.

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title feat: add E2E tests for routing form attribute conditions fix: include users without attributes in exclusion condition evaluation Feb 6, 2026
devin-ai-integration bot and others added 3 commits February 6, 2026 14:03
…ibutes

Users without attribute assignments are now included with empty attributes
so exclusion operators can match them. Updated test expectation accordingly.

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
…_prepareAssignmentData from main)

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title fix: include users without attributes in exclusion condition evaluation test: add E2E tests for routing form attribute conditions Feb 6, 2026
@joeauyeung joeauyeung marked this pull request as ready for review February 6, 2026 15:03
@graphite-app graphite-app bot requested a review from a team February 6, 2026 15:03
@graphite-app graphite-app bot added enterprise area: enterprise, audit log, organisation, SAML, SSO core area: core, team members only labels Feb 6, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Member

@joeauyeung There were some e2e tests in basic.e2e.ts, so we could change the PR description.

Also, we might want to move those tests too to the new test file.

@hariombalhara hariombalhara enabled auto-merge (squash) February 9, 2026 08:32
@hariombalhara hariombalhara merged commit f819f64 into main Feb 9, 2026
64 checks passed
@hariombalhara hariombalhara deleted the devin/1770317005-routing-form-attribute-e2e branch February 9, 2026 08:32
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 enterprise area: enterprise, audit log, organisation, SAML, SSO ready-for-e2e size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants