Skip to content

Commit 7dcc68e

Browse files
committed
test(core): focus global canonical move regression
1 parent 4798310 commit 7dcc68e

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

‎packages/core/test/session-move.test.ts‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,30 +163,18 @@ describe("Session.move", () => {
163163
const execution = yield* SessionExecution.Service
164164
const db = (yield* Database.Service).db
165165
const created = yield* sessions.create({ location: Location.Ref.make({ directory: source }) })
166-
const remaining = yield* sessions.create({ location: Location.Ref.make({ directory: source }) })
167166
// Match the reported existing database, where global already points at the source.
168167
yield* db.update(ProjectTable).set({ worktree: source }).where(eq(ProjectTable.id, Project.ID.global)).run()
169-
const before = yield* db.select().from(ProjectTable).where(eq(ProjectTable.id, Project.ID.global)).get()
170-
const other = yield* sessions.create({ location: Location.Ref.make({ directory: destination }) })
171168

172169
yield* Effect.promise(() => rm(source, { recursive: true }))
173170

174171
yield* sessions.move({ sessionID: created.id, directory: destination })
175172
yield* execution.awaitIdle(created.id)
176173

177-
expect(yield* sessions.get(created.id)).toMatchObject({
178-
projectID: Project.ID.global,
179-
location: { directory: destination },
180-
})
181-
expect((yield* sessions.list({ directory: source })).data.map((item) => item.id)).toEqual([remaining.id])
182-
expect((yield* sessions.list({ directory: destination })).data.map((item) => item.id)).toEqual(
183-
expect.arrayContaining([created.id, other.id]),
184-
)
174+
expect((yield* sessions.get(created.id)).location.directory).toBe(destination)
185175
expect(
186176
(yield* db.select().from(ProjectTable).where(eq(ProjectTable.id, Project.ID.global)).get())?.worktree,
187-
).toBe(before?.worktree)
188-
yield* sessions.remove(remaining.id)
189-
expect((yield* sessions.get(created.id)).location.directory).toBe(destination)
177+
).toBe(source)
190178
}),
191179
{ timeout: 120_000 },
192180
)

0 commit comments

Comments
 (0)