test: Fix flaky comments.list ordering assertion (#12329)

Two comments built back-to-back could share a millisecond-precision
createdAt, leaving the DESC-ordered result non-deterministic. Pass
explicit createdAt values so the assertion on body.data[1] is stable.
This commit is contained in:
Tom Moor
2026-05-12 20:03:54 -04:00
committed by GitHub
parent 935e0bb7b9
commit 42a0958322
@@ -187,10 +187,12 @@ describe("#comments.list", () => {
const comment = await buildComment({
userId: user.id,
documentId: document.id,
createdAt: new Date(Date.now() - 1000),
});
await buildResolvedComment(user, {
userId: user.id,
documentId: document.id,
createdAt: new Date(),
});
const res = await server.post("/api/comments.list", {
body: {