[
{"name": "a Wednesday morning order goes out today and arrives tomorrow", "args": ["2026-09-23", "10:00", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-23", "deliveryDate": "2026-09-24", "sameDayDispatch": true}},
{"name": "one minute before the cut-off still makes it", "args": ["2026-09-23", "14:59", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-23", "deliveryDate": "2026-09-24", "sameDayDispatch": true}},
{"name": "exactly at the cut-off misses it", "args": ["2026-09-23", "15:00", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-24", "deliveryDate": "2026-09-25", "sameDayDispatch": false}},
{"name": "Friday after the cut-off goes out on Monday", "args": ["2026-09-25", "16:00", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-28", "deliveryDate": "2026-09-29", "sameDayDispatch": false}},
{"name": "a Saturday order goes out on Monday even before the cut-off", "args": ["2026-09-26", "09:00", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-28", "deliveryDate": "2026-09-29", "sameDayDispatch": false}},
{"name": "Maundy Thursday after the cut-off skips Good Friday, the weekend and Easter Monday", "args": ["2026-04-02", "16:00", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-04-07", "deliveryDate": "2026-04-08", "sameDayDispatch": false}},
{"name": "Easter Monday is not a holiday in Scotland", "args": ["2026-04-06", "10:00", "15:00", 1, "scotland", []], "expect": {"dispatchDate": "2026-04-06", "deliveryDate": "2026-04-07", "sameDayDispatch": true}},
{"name": "Easter Monday is a holiday in England and Wales", "args": ["2026-04-06", "10:00", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-04-07", "deliveryDate": "2026-04-08", "sameDayDispatch": false}},
{"name": "Christmas Eve, two days: skips Christmas, the weekend and the Boxing Day substitute", "args": ["2026-12-24", "12:00", "15:00", 2, "england-and-wales", []], "expect": {"dispatchDate": "2026-12-24", "deliveryDate": "2026-12-30", "sameDayDispatch": true}},
{"name": "New Year's Eve: next year's New Year's Day is skipped too", "args": ["2026-12-31", "10:00", "15:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-12-31", "deliveryDate": "2027-01-04", "sameDayDispatch": true}},
{"name": "New Year's Eve in Scotland also skips the 2nd January substitute", "args": ["2026-12-31", "10:00", "15:00", 1, "scotland", []], "expect": {"dispatchDate": "2026-12-31", "deliveryDate": "2027-01-05", "sameDayDispatch": true}},
{"name": "five-day service over the August bank holiday", "args": ["2026-08-24", "09:00", "15:00", 5, "england-and-wales", []], "expect": {"dispatchDate": "2026-08-24", "deliveryDate": "2026-09-01", "sameDayDispatch": true}},
{"name": "same-day service arrives on the dispatch day", "args": ["2026-09-23", "10:00", "15:00", 0, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-23", "deliveryDate": "2026-09-23", "sameDayDispatch": true}},
{"name": "same-day service ordered too late arrives the next working day", "args": ["2026-09-23", "15:30", "15:00", 0, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-24", "deliveryDate": "2026-09-24", "sameDayDispatch": false}},
{"name": "no region: Christmas Day is a working day", "args": ["2026-12-24", "16:00", "15:00", 1, null, []], "expect": {"dispatchDate": "2026-12-25", "deliveryDate": "2026-12-28", "sameDayDispatch": false}},
{"name": "a closure in transit is skipped", "args": ["2026-09-23", "10:00", "15:00", 2, null, ["2026-09-24"]], "expect": {"dispatchDate": "2026-09-23", "deliveryDate": "2026-09-28", "sameDayDispatch": true}},
{"name": "a closure on the order day delays dispatch", "args": ["2026-09-23", "10:00", "15:00", 1, null, ["2026-09-23"]], "expect": {"dispatchDate": "2026-09-24", "deliveryDate": "2026-09-25", "sameDayDispatch": false}},
{"name": "a midnight cut-off means nothing goes the same day", "args": ["2026-09-23", "00:00", "00:00", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-24", "deliveryDate": "2026-09-25", "sameDayDispatch": false}},
{"name": "a cut-off of 23:59", "args": ["2026-09-23", "23:58", "23:59", 1, "england-and-wales", []], "expect": {"dispatchDate": "2026-09-23", "deliveryDate": "2026-09-24", "sameDayDispatch": true}},
{"name": "an estimate reaching a year gov.uk has not published", "args": ["2028-12-29", "10:00", "15:00", 1, "england-and-wales", []], "expectError": "no bank holiday data for england-and-wales in 2029"},
{"name": "a 12-hour time", "args": ["2026-09-23", "3pm", "15:00", 1, "england-and-wales", []], "expectError": "orderTime must be a 24-hour time HH:MM"},
{"name": "24:00 is not a time of day", "args": ["2026-09-23", "24:00", "15:00", 1, "england-and-wales", []], "expectError": "orderTime must be a 24-hour time HH:MM"},
{"name": "a cut-off with 60 minutes", "args": ["2026-09-23", "10:00", "15:60", 1, "england-and-wales", []], "expectError": "cutOff must be a 24-hour time HH:MM"},
{"name": "negative service days", "args": ["2026-09-23", "10:00", "15:00", -1, "england-and-wales", []], "expectError": "serviceDays must not be negative"},
{"name": "an impossible order date", "args": ["2026-02-30", "10:00", "15:00", 1, "england-and-wales", []], "expectError": "2026-02-30"},
{"name": "an unknown region", "args": ["2026-09-23", "10:00", "15:00", 1, "wales", []], "expectError": "unknown region \"wales\""}
]