Skip to content

Commit

Permalink
test: timing (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
jy95 committed Mar 26, 2024
1 parent 17f96a0 commit 4b550e8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions __tests__/timing.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,55 @@ describe("Timing common examples", () => {
},
},
},
{
title: "With breakfast",
expected: "at breakfast",
dosage: {
timing: {
repeat: {
when: ["CM"],
},
},
},
},
{
title: "For 5 minutes, 10 minutes before meals",
expected: "over 5 minutes - 10 minutes before meal",
dosage: {
timing: {
repeat: {
duration: 5,
durationUnit: "min",
when: ["AC"],
offset: 10,
},
},
},
},
{
title: "1 tablet 3 times daily, 30 minutes before meals",
expected: "1 tablet - 3 times every day - 30 minutes before meal",
dosage: {
doseAndRate: [
{
doseQuantity: {
value: 1,
unit: "tablet",
},
},
],
timing: {
repeat: {
frequency: 3,
period: 1,
periodUnit: "d",
when: ["AC"],
offset: 30,
},
},
},
},
// TODO start from "BID, 30 mins before meal, for next 10 days"
];

test.each(testCases)("$title", ({ dosage, expected }) => {
Expand Down

0 comments on commit 4b550e8

Please sign in to comment.