Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion site/src/components/Timeline/Timeline.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { createDisplayDate } from "./TimelineDateRow"

describe("createDisplayDate", () => {
it("returns correctly for Saturdays", () => {
const date = new Date("Sat Dec 03 2022 00:00:00 GMT-0500")
const now = new Date()
const date = new Date(
now.getFullYear(),
now.getMonth(),
// Previous Saturday, from now.
now.getDate() - now.getDay() - 1,
)
expect(createDisplayDate(date)).toEqual("last Saturday")
})
})