mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): Use relative date in Timeline test (#5377)
This commit is contained in:
@@ -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")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user