mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user