Skip to content

test(e2e): schedule editor flows for fixed-time, interval, PRN, days-of-week#85

Merged
JWhite212 merged 1 commit into
mainfrom
worktree-agent-a3ec35cae29413dea
May 19, 2026
Merged

test(e2e): schedule editor flows for fixed-time, interval, PRN, days-of-week#85
JWhite212 merged 1 commit into
mainfrom
worktree-agent-a3ec35cae29413dea

Conversation

@JWhite212

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/e2e/schedule-editor.test.ts with four Playwright tests under test.describe("schedule editor"):
    • Fixed-time daily (08:00, no day restriction)
    • Interval every 8h
    • PRN (as-needed)
    • Editing a fixed-time medication to restrict to Mon/Wed/Fri (daysOfWeek = [1,3,5])
  • Each test asserts the persisted medication_schedules row directly (scheduleKind, timeOfDay, intervalHours, daysOfWeek) and cleans up in finally via a cascade delete so reruns stay deterministic.
  • Extends tests/e2e/helpers/db.ts with getMedicationIdByName, getSchedulesForMedication, and deleteMedicationCascade — keeps the dynamic-import-of-db trick already used by dose-logging.test.ts.
  • Wires the new file into the authed project's testMatch regex in playwright.config.ts.

Why

The existing E2E suite covers auth, smoke, medication lifecycle, dose-logging, analytics, accessibility, and exports — but does NOT exercise the three schedule-kind editor flows end-to-end against the medication_schedules table. This closes that gap.

Test plan

  • npm test — Vitest passes (363 tests).
  • npm run check — 0 errors (pre-existing warnings unchanged).
  • DATABASE_URL=<placeholder> npm run build — passes.
  • npx playwright test --list tests/e2e/schedule-editor.test.ts — 4 tests discovered under the [authed] project.
  • Full E2E run deferred to CI (no configured DB locally).

…of-week

Adds Playwright coverage for the three schedule-kind editor flows
that the existing suite leaves untested: fixed-time, interval, and
PRN creation, plus the day-of-week restriction edit. Each test
asserts the persisted medication_schedules row directly against the
DB (kind, timeOfDay, intervalHours, daysOfWeek) and cleans up via a
cascade delete in finally so reruns stay deterministic.

Extends tests/e2e/helpers/db.ts with getMedicationIdByName,
getSchedulesForMedication, and deleteMedicationCascade. Wires the
new file into the authed project's testMatch regex.

Full E2E run deferred to CI (no DB configured locally).
@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@JWhite212 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37f26434-aa84-4e64-aeba-322b8a3e1cce

📥 Commits

Reviewing files that changed from the base of the PR and between 87eb209 and 861ec70.

📒 Files selected for processing (3)
  • playwright.config.ts
  • tests/e2e/helpers/db.ts
  • tests/e2e/schedule-editor.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JWhite212
JWhite212 merged commit 338359a into main May 19, 2026
7 checks passed
@JWhite212
JWhite212 deleted the worktree-agent-a3ec35cae29413dea branch May 19, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant