Skip to content

Commit a0aff82

Browse files
committed
test: scenario 4 part 2
1 parent d9dea67 commit a0aff82

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

packages/gsul/tests/testFilterOutFutureReduceToLatest.test.ts renamed to packages/gsul/tests/testFilterOutFutureReduceToLatestUpdates.test.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const scenarios: Array<scenariosType> = [
194194
itemId: "item_1",
195195
latestStatus: "With pharmacy",
196196
isTerminalState: false,
197-
lastUpdateDateTime: "1970-01-03T00:00:00Z" // Back to 'With pharmacy'
197+
lastUpdateDateTime: "1970-01-03T00:00:00Z" // revoke RTC, back to 'With pharmacy'
198198
},
199199
{
200200
itemId: "item_1",
@@ -302,6 +302,48 @@ const scenarios: Array<scenariosType> = [
302302
}
303303
]
304304
}
305+
},
306+
{
307+
scenarioDescription: "should return With pharmacy when RTC has been revoked but later RTC has matured",
308+
currentTime: new Date("2025-12-11T19:00:00Z").getTime(),
309+
inputPrescriptions: {
310+
prescriptionID: "abc",
311+
odsCode: "123"
312+
},
313+
queryResults: [
314+
{
315+
itemId: "item_1",
316+
latestStatus: "Ready to collect",
317+
isTerminalState: false,
318+
lastUpdateDateTime: "2025-12-11T19:00:00Z",
319+
postDatedLastModifiedSetAt: "2025-12-10T13:00:00Z"
320+
},
321+
{
322+
itemId: "item_1",
323+
latestStatus: "With pharmacy",
324+
isTerminalState: false,
325+
lastUpdateDateTime: "2025-12-10T11:00:00Z"
326+
}
327+
],
328+
expectedResult: {
329+
prescriptionID: "abc",
330+
onboarded: true,
331+
items: [
332+
{
333+
itemId: "item_1",
334+
latestStatus: "With pharmacy",
335+
isTerminalState: false,
336+
lastUpdateDateTime: "2025-12-10T11:00:00Z"
337+
},
338+
{
339+
itemId: "item_1",
340+
latestStatus: "Ready to collect",
341+
isTerminalState: false,
342+
lastUpdateDateTime: "2025-12-11T19:00:00Z",
343+
postDatedLastModifiedSetAt: "2025-12-10T13:00:00Z"
344+
}
345+
]
346+
}
305347
}
306348
]
307349
describe("Unit tests for buildResults", () => {

0 commit comments

Comments
 (0)