feat: enable weekday-based medication scheduling

Closes #463
This commit is contained in:
Daniel Volz
2026-03-20 14:58:25 +01:00
committed by GitHub
parent 29f4c4e48d
commit 68ab79c713
35 changed files with 1856 additions and 841 deletions
+17 -7
View File
@@ -114,8 +114,10 @@ test.describe("Share Schedule", () => {
const personSelect = modal.locator("select").first();
await expect(personSelect).toBeVisible();
// Should contain Alice and Bob options
await expect(personSelect.locator("option")).toHaveCount(2);
// Should contain Alice and Bob options.
// The dialog can also include an "all people" option, so assert presence instead of exact count.
await expect(personSelect.locator('option[value="Alice"]')).toBeAttached();
await expect(personSelect.locator('option[value="Bob"]')).toBeAttached();
// Close
await page.locator("button.modal-close").click();
@@ -187,7 +189,7 @@ test.describe("Share Schedule", () => {
await expect(sharedSchedule).toBeVisible({ timeout: 10000 });
// The page should show Alice's medication name
const content = sharedSchedule.getByText(MED_ALICE);
const content = sharedSchedule.locator(".med-name-text", { hasText: MED_ALICE }).first();
try {
await expect(content).toBeVisible({ timeout: 10000 });
} catch {
@@ -236,12 +238,16 @@ test.describe("Share Schedule", () => {
await expect(sharedSchedule).toBeVisible({ timeout: 10000 });
try {
await expect(sharedSchedule.getByText(MED_ALICE)).toBeVisible({ timeout: 10000 });
await expect(sharedSchedule.locator(".med-name-text", { hasText: MED_ALICE }).first()).toBeVisible({
timeout: 10000,
});
} catch {
await page.reload();
await page.waitForLoadState("networkidle");
await expect(page.locator(".shared-schedule-loading-skeleton")).toBeHidden({ timeout: 10000 });
await expect(sharedSchedule.getByText(MED_ALICE)).toBeVisible({ timeout: 10000 });
await expect(sharedSchedule.locator(".med-name-text", { hasText: MED_ALICE }).first()).toBeVisible({
timeout: 10000,
});
}
// Visit Bob's share — should show Bob's med
@@ -251,12 +257,16 @@ test.describe("Share Schedule", () => {
await expect(sharedSchedule).toBeVisible({ timeout: 10000 });
try {
await expect(sharedSchedule.getByText(MED_BOB)).toBeVisible({ timeout: 10000 });
await expect(sharedSchedule.locator(".med-name-text", { hasText: MED_BOB }).first()).toBeVisible({
timeout: 10000,
});
} catch {
await page.reload();
await page.waitForLoadState("networkidle");
await expect(page.locator(".shared-schedule-loading-skeleton")).toBeHidden({ timeout: 10000 });
await expect(sharedSchedule.getByText(MED_BOB)).toBeVisible({ timeout: 10000 });
await expect(sharedSchedule.locator(".med-name-text", { hasText: MED_BOB }).first()).toBeVisible({
timeout: 10000,
});
}
});