test(plugin): remove forbidden assertions in event tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+20
-20
@@ -488,19 +488,19 @@ describe("createEventHandler - idle deduplication", () => {
|
|||||||
it("both maps pruned on every event", async () => {
|
it("both maps pruned on every event", async () => {
|
||||||
//#given
|
//#given
|
||||||
const eventHandler = createEventHandler({
|
const eventHandler = createEventHandler({
|
||||||
ctx: {} as any,
|
ctx: asEventHandlerContext({}),
|
||||||
pluginConfig: {} as any,
|
pluginConfig: asPluginConfig({}),
|
||||||
firstMessageVariantGate: {
|
firstMessageVariantGate: {
|
||||||
markSessionCreated: () => {},
|
markSessionCreated: () => {},
|
||||||
clear: () => {},
|
clear: () => {},
|
||||||
},
|
},
|
||||||
managers: {
|
managers: createEventHandlerManagers({
|
||||||
tmuxSessionManager: {
|
tmuxSessionManager: {
|
||||||
onSessionCreated: async () => {},
|
onSessionCreated: async () => {},
|
||||||
onSessionDeleted: async () => {},
|
onSessionDeleted: async () => {},
|
||||||
},
|
},
|
||||||
} as any,
|
}),
|
||||||
hooks: {
|
hooks: createEventHandlerHooks({
|
||||||
autoUpdateChecker: { event: async () => {} },
|
autoUpdateChecker: { event: async () => {} },
|
||||||
claudeCodeHooks: { event: async () => {} },
|
claudeCodeHooks: { event: async () => {} },
|
||||||
backgroundNotificationHook: { event: async () => {} },
|
backgroundNotificationHook: { event: async () => {} },
|
||||||
@@ -520,7 +520,7 @@ describe("createEventHandler - idle deduplication", () => {
|
|||||||
stopContinuationGuard: { event: async () => {} },
|
stopContinuationGuard: { event: async () => {} },
|
||||||
compactionTodoPreserver: { event: async () => {} },
|
compactionTodoPreserver: { event: async () => {} },
|
||||||
atlasHook: { handler: async () => {} },
|
atlasHook: { handler: async () => {} },
|
||||||
} as any,
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
await eventHandler({
|
await eventHandler({
|
||||||
@@ -562,26 +562,26 @@ describe("createEventHandler - idle deduplication", () => {
|
|||||||
})
|
})
|
||||||
await wait(600)
|
await wait(600)
|
||||||
|
|
||||||
await eventHandler({
|
await eventHandler(asEventHandlerInput({
|
||||||
event: {
|
event: {
|
||||||
type: "message.updated",
|
type: "message.updated",
|
||||||
},
|
},
|
||||||
} as any)
|
}))
|
||||||
const dispatchCalls: EventInput[] = []
|
const dispatchCalls: EventInput[] = []
|
||||||
const eventHandlerWithMock = createEventHandler({
|
const eventHandlerWithMock = createEventHandler({
|
||||||
ctx: {} as any,
|
ctx: asEventHandlerContext({}),
|
||||||
pluginConfig: {} as any,
|
pluginConfig: asPluginConfig({}),
|
||||||
firstMessageVariantGate: {
|
firstMessageVariantGate: {
|
||||||
markSessionCreated: () => {},
|
markSessionCreated: () => {},
|
||||||
clear: () => {},
|
clear: () => {},
|
||||||
},
|
},
|
||||||
managers: {
|
managers: createEventHandlerManagers({
|
||||||
tmuxSessionManager: {
|
tmuxSessionManager: {
|
||||||
onSessionCreated: async () => {},
|
onSessionCreated: async () => {},
|
||||||
onSessionDeleted: async () => {},
|
onSessionDeleted: async () => {},
|
||||||
},
|
},
|
||||||
} as any,
|
}),
|
||||||
hooks: {
|
hooks: createEventHandlerHooks({
|
||||||
autoUpdateChecker: {
|
autoUpdateChecker: {
|
||||||
event: async (input: EventInput) => {
|
event: async (input: EventInput) => {
|
||||||
dispatchCalls.push(input)
|
dispatchCalls.push(input)
|
||||||
@@ -605,7 +605,7 @@ describe("createEventHandler - idle deduplication", () => {
|
|||||||
stopContinuationGuard: { event: async () => {} },
|
stopContinuationGuard: { event: async () => {} },
|
||||||
compactionTodoPreserver: { event: async () => {} },
|
compactionTodoPreserver: { event: async () => {} },
|
||||||
atlasHook: { handler: async () => {} },
|
atlasHook: { handler: async () => {} },
|
||||||
} as any,
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
await eventHandlerWithMock({
|
await eventHandlerWithMock({
|
||||||
@@ -624,19 +624,19 @@ describe("createEventHandler - idle deduplication", () => {
|
|||||||
it("dispatches both idle events once the dedup window expires", async () => {
|
it("dispatches both idle events once the dedup window expires", async () => {
|
||||||
const dispatchCalls: EventInput[] = []
|
const dispatchCalls: EventInput[] = []
|
||||||
const eventHandler = createEventHandler({
|
const eventHandler = createEventHandler({
|
||||||
ctx: {} as any,
|
ctx: asEventHandlerContext({}),
|
||||||
pluginConfig: {} as any,
|
pluginConfig: asPluginConfig({}),
|
||||||
firstMessageVariantGate: {
|
firstMessageVariantGate: {
|
||||||
markSessionCreated: () => {},
|
markSessionCreated: () => {},
|
||||||
clear: () => {},
|
clear: () => {},
|
||||||
},
|
},
|
||||||
managers: {
|
managers: createEventHandlerManagers({
|
||||||
tmuxSessionManager: {
|
tmuxSessionManager: {
|
||||||
onSessionCreated: async () => {},
|
onSessionCreated: async () => {},
|
||||||
onSessionDeleted: async () => {},
|
onSessionDeleted: async () => {},
|
||||||
},
|
},
|
||||||
} as any,
|
}),
|
||||||
hooks: {
|
hooks: createEventHandlerHooks({
|
||||||
autoUpdateChecker: {
|
autoUpdateChecker: {
|
||||||
event: async (input: EventInput) => {
|
event: async (input: EventInput) => {
|
||||||
if (input.event.type === "session.idle") {
|
if (input.event.type === "session.idle") {
|
||||||
@@ -662,7 +662,7 @@ describe("createEventHandler - idle deduplication", () => {
|
|||||||
stopContinuationGuard: { event: async () => {} },
|
stopContinuationGuard: { event: async () => {} },
|
||||||
compactionTodoPreserver: { event: async () => {} },
|
compactionTodoPreserver: { event: async () => {} },
|
||||||
atlasHook: { handler: async () => {} },
|
atlasHook: { handler: async () => {} },
|
||||||
} as any,
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
const sessionId = "ses_outside_window"
|
const sessionId = "ses_outside_window"
|
||||||
|
|||||||
Reference in New Issue
Block a user