authorgravatar for 269035359+t3-code[bot]@users.noreply.github.comt3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> 2026-10-03 16:29:18-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-03 16:29:18-03:00
logcfdff56f7b3c9c931ae368224041aa14825649fd
tree184d4ca839b80931e8a5f12123adb080b017f63e
parent77823bd102ae50430d4acda9a553e5743d2aa5ba
signature Signed by PGP key B5690EEEBB952194

test(web): remove redundant thread sort fallback tests (#15095)

Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>

1 files changed, 0 insertions(+), 50 deletions(-)

apps/web/src/lib/threadSort.test.ts-50
...@@ -117,56 +117,6 @@ describe("sortThreads", () => {...@@ -117,56 +117,6 @@ describe("sortThreads", () => {
117 ]);117 ]);
118 });118 });
119119
120 it("falls back to createdAt when updatedAt is invalid", () => {
121 const sorted = sortThreads(
122 [
123 makeThread({
124 id: ThreadId.make("thread-1"),
125 createdAt: "2026-03-09T10:00:00.000Z",
126 updatedAt: "invalid-date" as never,
127 messages: [],
128 }),
129 makeThread({
130 id: ThreadId.make("thread-2"),
131 createdAt: "2026-03-09T09:00:00.000Z",
132 updatedAt: "2026-03-09T09:30:00.000Z",
133 messages: [],
134 }),
135 ],
136 "updated_at",
137 );
138
139 expect(sorted.map((thread) => thread.id)).toEqual([
140 ThreadId.make("thread-1"),
141 ThreadId.make("thread-2"),
142 ]);
143 });
144
145 it("falls back to id ordering when threads have no sortable timestamps", () => {
146 const sorted = sortThreads(
147 [
148 makeThread({
149 id: ThreadId.make("thread-1"),
150 createdAt: "invalid-created-at" as never,
151 updatedAt: "invalid-updated-at" as never,
152 messages: [],
153 }),
154 makeThread({
155 id: ThreadId.make("thread-2"),
156 createdAt: "invalid-created-at" as never,
157 updatedAt: "invalid-updated-at" as never,
158 messages: [],
159 }),
160 ],
161 "updated_at",
162 );
163
164 expect(sorted.map((thread) => thread.id)).toEqual([
165 ThreadId.make("thread-2"),
166 ThreadId.make("thread-1"),
167 ]);
168 });
169
170 it("can sort threads by createdAt when configured", () => {120 it("can sort threads by createdAt when configured", () => {
171 const sorted = sortThreads(121 const sorted = sortThreads(
172 [122 [