test(web): remove redundant thread sort fallback tests (#15095)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
77823bd102
commit
cfdff56f7b
1 file changed
-50
@@ -117,56 +117,6 @@ describe("sortThreads", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("falls back to createdAt when updatedAt is invalid", () => {
|
||||
const sorted = sortThreads(
|
||||
[
|
||||
makeThread({
|
||||
id: ThreadId.make("thread-1"),
|
||||
createdAt: "2026-03-09T10:00:00.000Z",
|
||||
updatedAt: "invalid-date" as never,
|
||||
messages: [],
|
||||
}),
|
||||
makeThread({
|
||||
id: ThreadId.make("thread-2"),
|
||||
createdAt: "2026-03-09T09:00:00.000Z",
|
||||
updatedAt: "2026-03-09T09:30:00.000Z",
|
||||
messages: [],
|
||||
}),
|
||||
],
|
||||
"updated_at",
|
||||
);
|
||||
|
||||
expect(sorted.map((thread) => thread.id)).toEqual([
|
||||
ThreadId.make("thread-1"),
|
||||
ThreadId.make("thread-2"),
|
||||
]);
|
||||
});
|
||||
|
||||
it("falls back to id ordering when threads have no sortable timestamps", () => {
|
||||
const sorted = sortThreads(
|
||||
[
|
||||
makeThread({
|
||||
id: ThreadId.make("thread-1"),
|
||||
createdAt: "invalid-created-at" as never,
|
||||
updatedAt: "invalid-updated-at" as never,
|
||||
messages: [],
|
||||
}),
|
||||
makeThread({
|
||||
id: ThreadId.make("thread-2"),
|
||||
createdAt: "invalid-created-at" as never,
|
||||
updatedAt: "invalid-updated-at" as never,
|
||||
messages: [],
|
||||
}),
|
||||
],
|
||||
"updated_at",
|
||||
);
|
||||
|
||||
expect(sorted.map((thread) => thread.id)).toEqual([
|
||||
ThreadId.make("thread-2"),
|
||||
ThreadId.make("thread-1"),
|
||||
]);
|
||||
});
|
||||
|
||||
it("can sort threads by createdAt when configured", () => {
|
||||
const sorted = sortThreads(
|
||||
[
|
||||
|
||||
Reference in new issue
Block a user