Add E2E test for department selector infinite scroll#16293
Add E2E test for department selector infinite scroll#16293nihal467 wants to merge 2 commits intoENG-22-add-infinite-scroll-to-department-selectorfrom
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Deploying care-preview with
|
| Latest commit: |
9b03e34
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://461159e2.care-preview-a7w.pages.dev |
| Branch Preview URL: | https://eng-22-e2e-test-infinite-scr.care-preview-a7w.pages.dev |
- Test creates 25 departments via API (exceeding PAGE_LIMIT of 20) - Navigates to Users → See Details → Departments tab → Link Department - Switches to All Organizations tab, opens combobox dropdown - Verifies first page of departments loads as role='option' items - Scrolls command list to bottom, verifies more items load via infinite scroll - Enable dotenv in playwright.config.ts for API URL access in tests
- Creates 25 departments via API in beforeAll (exceeding PAGE_LIMIT of 20) - Navigates to Users > See Details > Departments > Link Department - Switches to All Organizations, opens combobox dropdown - Verifies first page of departments loads - Scrolls to bottom, waits for paginated API request (offset param) - Verifies more items render after the response - Enables dotenv in playwright.config.ts for API URL access
8e9469f to
9b03e34
Compare
Description
Adds an E2E Playwright test that verifies infinite scroll works correctly in the department selector dropdown (
FacilityOrganizationSelector).What the test does
beforeAll— exceedsPAGE_LIMIT(20) to ensure pagination is triggeredrole="option")/organizations/withoffset=param, status 200) — provesfetchNextPagewas actually calledOther changes
dotenvinplaywright.config.tssoREACT_CARE_API_URLis available in testbeforeAllhooksNote
The department creation via direct API calls in
beforeAllis a temporary hack until the backend fixtures are updated to include enough departments for pagination testing. Once fixtures provide 20+ departments out of the box, the API creation logic can be removed.