The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { EnvironmentId, ProjectId, SourceControlProviderKind } from "@t3tools/contracts"; |
| 2 | import { describe, expect, it } from "vite-plus/test"; |
| 3 | |
| 4 | import type { EnvironmentProject } from "./models.ts"; |
| 5 | import { chooseLoadBalancedEnvironment } from "../load-balancing.ts"; |
| 6 | import { |
| 7 | buildProjectGroups, |
| 8 | deriveLogicalProjectKeyFromSettings, |
| 9 | pickableProjectGroups, |
| 10 | derivePhysicalProjectKey, |
| 11 | resolveScratchProjectScopeKey, |
| 12 | sortProjectsByGroupOrder, |
| 13 | type ProjectGroupingSettings, |
| 14 | } from "./projectGrouping.ts"; |
| 15 | |
| 16 | const environmentId = EnvironmentId.make("environment"); |
| 17 | |
| 18 | describe("load balancing shared project machines", () => { |
| 19 | const now = 100_000; |
| 20 | const resources = { |
| 21 | sampledAt: now, |
| 22 | cpuUtilization: 0.2, |
| 23 | cpuCount: 8, |
| 24 | availableMemoryBytes: 8_000, |
| 25 | totalMemoryBytes: 16_000, |
| 26 | }; |
| 27 | |
| 28 | it("compares three machines using free capacity and preference", () => { |
| 29 | const candidates = [ |
| 30 | { environmentId: "busy", resources: { ...resources, cpuUtilization: 0.9 }, weight: 1 }, |
| 31 | { environmentId: "idle", resources, weight: 1 }, |
| 32 | { environmentId: "preferred", resources: { ...resources, cpuCount: 4 }, weight: 3 }, |
| 33 | ]; |
| 34 | expect(chooseLoadBalancedEnvironment(candidates, now)).toBe("preferred"); |
| 35 | expect(chooseLoadBalancedEnvironment(candidates.slice(0, 2), now)).toBe("idle"); |
| 36 | }); |
| 37 | |
| 38 | it("rejects stale, unknown, excluded and saturated machines", () => { |
| 39 | expect( |
| 40 | chooseLoadBalancedEnvironment( |
| 41 | [ |
| 42 | { |
| 43 | environmentId: "stale", |
| 44 | resources: { ...resources, sampledAt: now - 15_001 }, |
| 45 | weight: 1, |
| 46 | }, |
| 47 | { environmentId: "unknown", resources: null, weight: 1 }, |
| 48 | { |
| 49 | environmentId: "no-cpu-sample", |
| 50 | resources: { ...resources, cpuUtilization: null }, |
| 51 | weight: 1, |
| 52 | }, |
| 53 | { environmentId: "excluded", resources, weight: 0 }, |
| 54 | { |
| 55 | environmentId: "cpu-full", |
| 56 | resources: { ...resources, cpuUtilization: 0.95 }, |
| 57 | weight: 1, |
| 58 | }, |
| 59 | { |
| 60 | environmentId: "memory-full", |
| 61 | resources: { ...resources, availableMemoryBytes: 100 }, |
| 62 | weight: 1, |
| 63 | }, |
| 64 | ], |
| 65 | now, |
| 66 | ), |
| 67 | ).toBeNull(); |
| 68 | }); |
| 69 | |
| 70 | it("uses client receipt time when host clocks differ", () => { |
| 71 | const candidate = { |
| 72 | environmentId: "different-clock", |
| 73 | resources: { ...resources, sampledAt: now + 60_000 }, |
| 74 | receivedAt: now, |
| 75 | weight: 1, |
| 76 | }; |
| 77 | expect(chooseLoadBalancedEnvironment([candidate], now)).toBe("different-clock"); |
| 78 | expect(chooseLoadBalancedEnvironment([candidate], now + 15_001)).toBeNull(); |
| 79 | }); |
| 80 | }); |
| 81 | const repositoryIdentity = { |
| 82 | canonicalKey: "github.com/t3tools/t3code", |
| 83 | locator: { |
| 84 | source: "git-remote" as const, |
| 85 | remoteName: "upstream", |
| 86 | remoteUrl: "https://github.com/t3tools/t3code.git", |
| 87 | }, |
| 88 | provider: SourceControlProviderKind.make("github"), |
| 89 | owner: "t3tools", |
| 90 | name: "t3code", |
| 91 | displayName: "T3 Code", |
| 92 | }; |
| 93 | |
| 94 | function makeProject( |
| 95 | id: string, |
| 96 | workspaceRoot: string, |
| 97 | overrides: Partial<EnvironmentProject> = {}, |
| 98 | ): EnvironmentProject { |
| 99 | return { |
| 100 | environmentId, |
| 101 | id: ProjectId.make(id), |
| 102 | title: id, |
| 103 | workspaceRoot, |
| 104 | repositoryIdentity, |
| 105 | defaultModelSelection: null, |
| 106 | scripts: [], |
| 107 | createdAt: "2026-07-01T00:00:00.000Z", |
| 108 | updatedAt: "2026-07-01T00:00:00.000Z", |
| 109 | ...overrides, |
| 110 | }; |
| 111 | } |
| 112 | |
| 113 | function settings( |
| 114 | mode: ProjectGroupingSettings["sidebarProjectGroupingMode"], |
| 115 | overrides: ProjectGroupingSettings["sidebarProjectGroupingOverrides"] = {}, |
| 116 | ): ProjectGroupingSettings { |
| 117 | return { |
| 118 | sidebarProjectGroupingMode: mode, |
| 119 | sidebarProjectGroupingOverrides: overrides, |
| 120 | }; |
| 121 | } |
| 122 | |
| 123 | describe("buildProjectGroups", () => { |
| 124 | it.each(["repository", "repository_path", "separate"] as const)( |
| 125 | "keeps scratch project ownership separate by default in %s mode", |
| 126 | (mode) => { |
| 127 | const projects = [ |
| 128 | makeProject("scratch-local", "/local/scratch", { |
| 129 | isScratch: true, |
| 130 | repositoryIdentity: null, |
| 131 | }), |
| 132 | makeProject("scratch-remote", "/remote/scratch", { |
| 133 | environmentId: EnvironmentId.make("remote"), |
| 134 | isScratch: true, |
| 135 | repositoryIdentity: null, |
| 136 | }), |
| 137 | ]; |
| 138 | const groups = buildProjectGroups({ projects, settings: settings(mode) }); |
| 139 | expect(groups.map((group) => group.key)).toEqual(projects.map(derivePhysicalProjectKey)); |
| 140 | expect(groups.map((group) => group.memberProjectRefs)).toEqual( |
| 141 | projects.map((project) => [ |
| 142 | { environmentId: project.environmentId, projectId: project.id }, |
| 143 | ]), |
| 144 | ); |
| 145 | expect( |
| 146 | buildProjectGroups({ projects, settings: settings(mode), groupScratchProjects: true }), |
| 147 | ).toHaveLength(1); |
| 148 | }, |
| 149 | ); |
| 150 | |
| 151 | it.each(["repository", "repository_path", "separate"] as const)( |
| 152 | "migrates a pre-config %s scratch selection and retains it after the original host is removed", |
| 153 | (mode) => { |
| 154 | const local = makeProject("scratch-local", "/local/repo/scratch", { |
| 155 | repositoryIdentity: { ...repositoryIdentity, rootPath: "/local/repo" }, |
| 156 | }); |
| 157 | const remote = makeProject("scratch-remote", "/remote/scratch", { |
| 158 | environmentId: EnvironmentId.make("remote"), |
| 159 | repositoryIdentity: null, |
| 160 | isScratch: true, |
| 161 | }); |
| 162 | const groupingSettings = settings(mode); |
| 163 | const selectedBeforeConfig = deriveLogicalProjectKeyFromSettings(local, groupingSettings); |
| 164 | const loaded = [{ ...local, isScratch: true as const }, remote]; |
| 165 | const migrated = resolveScratchProjectScopeKey( |
| 166 | selectedBeforeConfig, |
| 167 | loaded, |
| 168 | groupingSettings, |
| 169 | ); |
| 170 | const scratchKey = buildProjectGroups({ |
| 171 | projects: loaded, |
| 172 | settings: groupingSettings, |
| 173 | groupScratchProjects: true, |
| 174 | })[0]!.key; |
| 175 | expect(migrated).toBe(scratchKey); |
| 176 | expect(resolveScratchProjectScopeKey(migrated, [remote], groupingSettings)).toBe(scratchKey); |
| 177 | expect( |
| 178 | buildProjectGroups({ |
| 179 | projects: [remote], |
| 180 | settings: groupingSettings, |
| 181 | groupScratchProjects: true, |
| 182 | })[0]?.memberProjectRefs, |
| 183 | ).toEqual([{ environmentId: remote.environmentId, projectId: remote.id }]); |
| 184 | }, |
| 185 | ); |
| 186 | |
| 187 | it("retains a repository filter that still belongs to an ordinary project", () => { |
| 188 | const scratch = makeProject("scratch", "/scratch", { isScratch: true }); |
| 189 | const ordinary = makeProject("ordinary", "/ordinary"); |
| 190 | const key = deriveLogicalProjectKeyFromSettings(ordinary, settings("repository")); |
| 191 | expect(resolveScratchProjectScopeKey(key, [scratch, ordinary])).toBe(key); |
| 192 | }); |
| 193 | |
| 194 | it.each(["repository", "repository_path", "separate"] as const)( |
| 195 | "coalesces scratch homes in %s mode without merging ordinary same-title projects", |
| 196 | (mode) => { |
| 197 | const remoteEnvironmentId = EnvironmentId.make("remote"); |
| 198 | const projects = [ |
| 199 | makeProject("scratch-local", "/local/scratch", { |
| 200 | title: "No project", |
| 201 | isScratch: true, |
| 202 | repositoryIdentity: null, |
| 203 | }), |
| 204 | makeProject("scratch-remote", "/remote/scratch", { |
| 205 | title: "No project", |
| 206 | environmentId: remoteEnvironmentId, |
| 207 | isScratch: true, |
| 208 | }), |
| 209 | makeProject("scratch-duplicate", "/remote/scratch/", { |
| 210 | title: "No project", |
| 211 | environmentId: remoteEnvironmentId, |
| 212 | isScratch: true, |
| 213 | repositoryIdentity: null, |
| 214 | updatedAt: "2026-07-02T00:00:00.000Z", |
| 215 | }), |
| 216 | makeProject("ordinary", "/ordinary", { title: "No project" }), |
| 217 | makeProject("reserved-collision", "/other", { |
| 218 | title: "No project", |
| 219 | repositoryIdentity: { ...repositoryIdentity, canonicalKey: "\0no-project" }, |
| 220 | }), |
| 221 | ]; |
| 222 | const groups = buildProjectGroups({ |
| 223 | projects, |
| 224 | groupScratchProjects: true, |
| 225 | settings: settings(mode, { [derivePhysicalProjectKey(projects[0]!)]: "separate" }), |
| 226 | preferredEnvironmentId: remoteEnvironmentId, |
| 227 | }); |
| 228 | expect(groups).toHaveLength(3); |
| 229 | const scratch = groups.find((group) => group.representative.isScratch)!; |
| 230 | expect(scratch.label).toBe("No project"); |
| 231 | expect(scratch.representative.id).toBe(projects[2]?.id); |
| 232 | expect(scratch.members).toHaveLength(2); |
| 233 | expect(scratch.memberProjectRefs).toEqual( |
| 234 | projects.slice(0, 3).map((project) => ({ |
| 235 | environmentId: project.environmentId, |
| 236 | projectId: project.id, |
| 237 | })), |
| 238 | ); |
| 239 | expect(resolveScratchProjectScopeKey(derivePhysicalProjectKey(projects[1]!), projects)).toBe( |
| 240 | scratch.key, |
| 241 | ); |
| 242 | expect(resolveScratchProjectScopeKey(derivePhysicalProjectKey(projects[3]!), projects)).toBe( |
| 243 | derivePhysicalProjectKey(projects[3]!), |
| 244 | ); |
| 245 | expect(groups.filter((group) => !group.representative.isScratch)).toHaveLength(2); |
| 246 | }, |
| 247 | ); |
| 248 | |
| 249 | it("preserves every physical clone as a selectable member in repository modes", () => { |
| 250 | const projects = [ |
| 251 | makeProject("t3code", "/work/t3code"), |
| 252 | makeProject("t3code-2", "/work/t3code-2"), |
| 253 | makeProject("t3code-3", "/work/t3code-3"), |
| 254 | ]; |
| 255 | |
| 256 | for (const mode of ["repository", "repository_path"] as const) { |
| 257 | const groups = buildProjectGroups({ projects, settings: settings(mode) }); |
| 258 | expect(groups).toHaveLength(1); |
| 259 | expect(groups[0]?.members.map((member) => member.project.id)).toEqual([ |
| 260 | "t3code", |
| 261 | "t3code-2", |
| 262 | "t3code-3", |
| 263 | ]); |
| 264 | expect(groups[0]?.memberProjectRefs).toHaveLength(3); |
| 265 | } |
| 266 | }); |
| 267 | |
| 268 | it("keeps a fork apart from its upstream checkout and labels it by its own remote", () => { |
| 269 | const fork = makeProject("fork", "/work/t3code-fork", { |
| 270 | repositoryIdentity: { |
| 271 | ...repositoryIdentity, |
| 272 | origin: { |
| 273 | canonicalKey: "github.com/julius/t3code-fork", |
| 274 | displayName: "julius/t3code-fork", |
| 275 | }, |
| 276 | }, |
| 277 | }); |
| 278 | const forkWorktree = makeProject("fork-2", "/work/t3code-fork-2", { |
| 279 | repositoryIdentity: fork.repositoryIdentity, |
| 280 | }); |
| 281 | const projects = [makeProject("t3code", "/work/t3code"), fork, forkWorktree]; |
| 282 | |
| 283 | const groups = buildProjectGroups({ projects, settings: settings("repository") }); |
| 284 | expect(groups.map((group) => group.key)).toEqual([ |
| 285 | "github.com/t3tools/t3code", |
| 286 | "github.com/julius/t3code-fork", |
| 287 | ]); |
| 288 | expect(groups[1]?.members.map((member) => member.project.id)).toEqual(["fork", "fork-2"]); |
| 289 | expect(groups[1]?.label).toBe("julius/t3code-fork"); |
| 290 | }); |
| 291 | |
| 292 | // regression: #15049 a rename to the repository name snapped back to the display path |
| 293 | it("labels a renamed group by its title even when it matches the repository name", () => { |
| 294 | const folderTitles = [ |
| 295 | makeProject("t3code", "/work/t3code", { title: "t3code" }), |
| 296 | makeProject("t3code-2", "/work/t3code-2", { title: "t3code" }), |
| 297 | ]; |
| 298 | const renamed = folderTitles.map((project) => ({ ...project, hasCustomTitle: true })); |
| 299 | |
| 300 | const label = (projects: ReadonlyArray<EnvironmentProject>) => |
| 301 | buildProjectGroups({ projects, settings: settings("repository") })[0]?.label; |
| 302 | expect(label(folderTitles)).toBe("T3 Code"); |
| 303 | expect(label(renamed)).toBe("t3code"); |
| 304 | }); |
| 305 | |
| 306 | it("labels a group by its repository when clones disagree on its casing", () => { |
| 307 | // A subfolder project, its repository root, and a clone whose remote URL is |
| 308 | // lowercased: no shared title or display name, but one repository. |
| 309 | const subfolder = makeProject("design-study", "/work/NewCo/reference/design-study"); |
| 310 | const root = makeProject("NewCo", "/work/NewCo"); |
| 311 | const lowercasedClone = makeProject("NewCo", "/remote/NewCo", { |
| 312 | environmentId: EnvironmentId.make("remote"), |
| 313 | repositoryIdentity: { ...repositoryIdentity, name: "T3CODE", displayName: "t3 code" }, |
| 314 | }); |
| 315 | |
| 316 | const groups = buildProjectGroups({ |
| 317 | projects: [subfolder, root, lowercasedClone], |
| 318 | settings: settings("repository"), |
| 319 | preferredEnvironmentId: environmentId, |
| 320 | }); |
| 321 | expect(groups).toHaveLength(1); |
| 322 | expect(groups[0]?.label).toBe("T3 Code"); |
| 323 | |
| 324 | // A subfolder group in repository_path mode keeps its own title. |
| 325 | const localIdentity = { ...repositoryIdentity, rootPath: "/work/t3code" }; |
| 326 | const pathGroups = buildProjectGroups({ |
| 327 | projects: [ |
| 328 | makeProject("design", "/work/t3code/design", { |
| 329 | title: "Design docs", |
| 330 | hasCustomTitle: true, |
| 331 | repositoryIdentity: localIdentity, |
| 332 | }), |
| 333 | makeProject("design", "/remote/t3code/design", { |
| 334 | environmentId: EnvironmentId.make("remote"), |
| 335 | repositoryIdentity: { |
| 336 | ...repositoryIdentity, |
| 337 | rootPath: "/remote/t3code", |
| 338 | name: "T3CODE", |
| 339 | displayName: "t3 code", |
| 340 | }, |
| 341 | }), |
| 342 | makeProject("t3code", "/work/t3code", { repositoryIdentity: localIdentity }), |
| 343 | ], |
| 344 | settings: settings("repository_path"), |
| 345 | preferredEnvironmentId: environmentId, |
| 346 | }); |
| 347 | expect(pathGroups.map((group) => group.label)).toEqual(["Design docs", "t3code"]); |
| 348 | }); |
| 349 | |
| 350 | it("applies a physical-project override without dropping its siblings", () => { |
| 351 | const first = makeProject("t3code", "/work/t3code"); |
| 352 | const second = makeProject("t3code-2", "/work/t3code-2"); |
| 353 | const third = makeProject("t3code-3", "/work/t3code-3"); |
| 354 | const groups = buildProjectGroups({ |
| 355 | projects: [first, second, third], |
| 356 | settings: settings("repository", { |
| 357 | [derivePhysicalProjectKey(second)]: "separate", |
| 358 | }), |
| 359 | }); |
| 360 | |
| 361 | expect(groups).toHaveLength(2); |
| 362 | expect(groups.flatMap((group) => group.members.map((member) => member.project.id))).toEqual([ |
| 363 | "t3code", |
| 364 | "t3code-3", |
| 365 | "t3code-2", |
| 366 | ]); |
| 367 | }); |
| 368 | |
| 369 | it("dedupes stale registrations at one physical path using the freshest project", () => { |
| 370 | const stale = makeProject("stale", "/work/t3code", { |
| 371 | repositoryIdentity: null, |
| 372 | updatedAt: "2026-07-01T00:00:00.000Z", |
| 373 | }); |
| 374 | const fresh = makeProject("fresh", "/work/t3code/", { |
| 375 | updatedAt: "2026-07-02T00:00:00.000Z", |
| 376 | }); |
| 377 | |
| 378 | const groups = buildProjectGroups({ |
| 379 | projects: [stale, fresh], |
| 380 | settings: settings("repository"), |
| 381 | }); |
| 382 | expect(groups).toHaveLength(1); |
| 383 | expect(groups[0]?.members).toHaveLength(1); |
| 384 | expect(groups[0]?.representative.id).toBe("fresh"); |
| 385 | expect(groups[0]?.memberProjectRefs).toHaveLength(2); |
| 386 | }); |
| 387 | |
| 388 | it("uses the freshest winner's repository identity when stale duplicates disagree", () => { |
| 389 | const staleIdentity = { |
| 390 | ...repositoryIdentity, |
| 391 | canonicalKey: "github.com/t3tools/old-repository", |
| 392 | name: "old-repository", |
| 393 | displayName: "Old Repository", |
| 394 | }; |
| 395 | const stale = makeProject("stale", "/work/t3code", { |
| 396 | repositoryIdentity: staleIdentity, |
| 397 | updatedAt: "2026-07-01T00:00:00.000Z", |
| 398 | }); |
| 399 | const fresh = makeProject("fresh", "/work/t3code/", { |
| 400 | updatedAt: "2026-07-02T00:00:00.000Z", |
| 401 | }); |
| 402 | const sibling = makeProject("sibling", "/work/t3code-2"); |
| 403 | |
| 404 | const groups = buildProjectGroups({ |
| 405 | projects: [stale, fresh, sibling], |
| 406 | settings: settings("repository"), |
| 407 | }); |
| 408 | expect(groups).toHaveLength(1); |
| 409 | expect(groups[0]?.members.map((member) => member.project.id)).toEqual(["fresh", "sibling"]); |
| 410 | }); |
| 411 | |
| 412 | it("uses the freshest identity-bearing duplicate when the winner lacks identity", () => { |
| 413 | const staleIdentity = { |
| 414 | ...repositoryIdentity, |
| 415 | canonicalKey: "github.com/t3tools/old-repository", |
| 416 | name: "old-repository", |
| 417 | displayName: "Old Repository", |
| 418 | }; |
| 419 | const staleIdentified = makeProject("stale-identified", "/work/t3code", { |
| 420 | repositoryIdentity: staleIdentity, |
| 421 | updatedAt: "2026-07-01T00:00:00.000Z", |
| 422 | }); |
| 423 | const freshIdentified = makeProject("fresh-identified", "/work/t3code/", { |
| 424 | updatedAt: "2026-07-02T00:00:00.000Z", |
| 425 | }); |
| 426 | const winner = makeProject("winner", "/work/t3code", { |
| 427 | repositoryIdentity: null, |
| 428 | updatedAt: "2026-07-03T00:00:00.000Z", |
| 429 | }); |
| 430 | const sibling = makeProject("sibling", "/work/t3code-2"); |
| 431 | |
| 432 | const groups = buildProjectGroups({ |
| 433 | projects: [staleIdentified, freshIdentified, winner, sibling], |
| 434 | settings: settings("repository"), |
| 435 | }); |
| 436 | expect(groups).toHaveLength(1); |
| 437 | expect(groups[0]?.members.map((member) => member.project.id)).toEqual(["winner", "sibling"]); |
| 438 | }); |
| 439 | }); |
| 440 | |
| 441 | describe("project pins and archives", () => { |
| 442 | const at = "2026-07-02T00:00:00.000Z"; |
| 443 | const remote = EnvironmentId.make("remote"); |
| 444 | const group = (...projects: EnvironmentProject[]) => |
| 445 | buildProjectGroups({ projects, settings: settings("repository") })[0]!; |
| 446 | |
| 447 | it("keeps a project visible while its machines disagree", () => { |
| 448 | const local = makeProject("local", "/work/t3code"); |
| 449 | const other = makeProject("remote", "/work/t3code", { environmentId: remote }); |
| 450 | const partial = group({ ...local, pinnedAt: at, archivedAt: at }, other); |
| 451 | expect(partial).toMatchObject({ pinned: true, archived: false }); |
| 452 | expect(group({ ...local, archivedAt: at }, { ...other, archivedAt: at }).archived).toBe(true); |
| 453 | }); |
| 454 | |
| 455 | it("offers pinned projects first and leaves archived ones out", () => { |
| 456 | const pickable = pickableProjectGroups([ |
| 457 | { key: "a", pinned: false, archived: false }, |
| 458 | { key: "b", pinned: true, archived: true }, |
| 459 | { key: "c", pinned: true, archived: false }, |
| 460 | { key: "d", pinned: false, archived: true }, |
| 461 | ]); |
| 462 | expect(pickable.map((entry) => entry.key)).toEqual(["c", "a"]); |
| 463 | }); |
| 464 | }); |
| 465 | |
| 466 | describe("sortProjectsByGroupOrder", () => { |
| 467 | const remote = EnvironmentId.make("remote"); |
| 468 | const ref = (projectId: string, env = environmentId) => ({ |
| 469 | environmentId: env, |
| 470 | projectId: ProjectId.make(projectId), |
| 471 | }); |
| 472 | const project = (id: string, env: string = environmentId) => ({ id, environmentId: env }); |
| 473 | |
| 474 | it("tells the same project id on two environments apart", () => { |
| 475 | const sorted = sortProjectsByGroupOrder( |
| 476 | [project("shared"), project("shared", remote)], |
| 477 | [ |
| 478 | { memberProjectRefs: [ref("shared", remote)], pinned: false, archived: false }, |
| 479 | { memberProjectRefs: [ref("shared")], pinned: false, archived: false }, |
| 480 | ], |
| 481 | ); |
| 482 | expect(sorted.map((entry) => entry.environmentId)).toEqual([remote, environmentId]); |
| 483 | }); |
| 484 | |
| 485 | it("lists pinned projects first and archived ones last, like the sidebar's project menu", () => { |
| 486 | const sorted = sortProjectsByGroupOrder( |
| 487 | [project("archived"), project("recent"), project("pinned"), project("unlisted")], |
| 488 | [ |
| 489 | { memberProjectRefs: [ref("archived")], pinned: false, archived: true }, |
| 490 | { memberProjectRefs: [ref("recent")], pinned: false, archived: false }, |
| 491 | { memberProjectRefs: [ref("pinned")], pinned: true, archived: false }, |
| 492 | ], |
| 493 | ); |
| 494 | expect(sorted.map((entry) => entry.id)).toEqual(["pinned", "recent", "archived", "unlisted"]); |
| 495 | }); |
| 496 | }); |