Project: Nadia's Short Refund

Your shelf count fix is done. The saved check failed before it and passes after it, the course’s tests pass, and the order path still reserves copies the way it did. Grace’s next message is a customer’s email, and this time it’s about money.

In this project, you’ll take that email from a vague complaint to a fixed bug with evidence behind every step. You’ll reproduce it, find where the shop gets it wrong, learn which commit introduced the bug and why the code changed, and make the smallest fix and verify it with a saved check. Nobody will tell you where the fault is. Start where the report starts, with what the customer says happened.

Read Nadia’s Report

Grace has filed the email as issue #41, so it’s in your clone with the rest of the history. Open docs/issues/41.md. Its first lines hold Nadia Patel’s report, as Grace relayed it:

Language: Markdown Text
# #41 · Returning Small Maps was £1.50 short

**Nadia's report, relayed by Grace:** I paid £24 for Small Maps (£7.50) and The
Long Way Home (£22.50) with READ20. A Bookshop Window was a complimentary
£10 title. I returned Small Maps. The shop returned £4.50; I expected £6.

Split it the way you split Grace’s shelf count note in Reproduce a Bug Report. Each part does a different job:

  • Did: Nadia bought Small Maps and The Long Way Home with the READ20 code, received A Bookshop Window free, and returned Small Maps.
  • Saw: The shop returned £4.50, which is 450p in the integer pence the code stores.
  • Concluded: She should have had £6, so the refund was £1.50 short.

Use the first two parts to reproduce the bug. The third is a hypothesis, and so is any guess about the cause, so check each hypothesis before you build on it. Is £6 what the shop should refund, or only what Nadia hoped for?

The shop has a written rule to check it against. Line 17 of docs/ARCHITECTURE.md, in Ada’s overview, says:

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.