DrillsGreen tests, no refunds
Green tests, no refunds
What happened
When a team cancels mid-month, Harbor refunds the days after the cancellation day. Last week Cursor changed the billing code to use the payment provider’s status names, and every test stayed green. Since then, no team that cancelled has had a refund, and the refund test has passed on every run, including the one for that change.
Kestrel Studio, a Harbor customerWe cancelled our Team plan on 21 November. Your terms say we get the unused days back. Nothing has arrived, and support says the system shows no refund due.
The MagisterRun it first and read what comes back. Then change the code if you like: your edits go to the review too.
Run executes this test file against today’s refund.js. The checks also try your tests against a correct refund.js and one that refunds a day too many.
// billing/refund.test.js
// Bench loads refundFor from billing/refund.js before this file runs.
// test and expect work like Vitest's.
const invoice = {
id: "inv_3107",
status: "paid",
chargeId: "ch_DEMO_8812",
amount: 3000, // Team, November, in cents
daysInMonth: 30,
};
test("refunds the unused days when a team cancels mid-month", () => {
const refund = refundFor(invoice, 21);
if (refund) {
expect(refund.amount).toBe(900);
}
});
The code runs in your browser against stand-in data. Nothing is sent anywhere.
Your answer
Reviewed by AI against what a good fix needs. About 10 seconds.Sign in to get your answer reviewed
It's free. Anything you've typed here stays in this browser and is waiting when you come back.
Sign in with email