test(auto-reply): trim setup resets in block streaming and subagent focus
This commit is contained in:
@@ -89,10 +89,10 @@ async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||
describe("block streaming", () => {
|
||||
beforeEach(() => {
|
||||
vi.stubEnv("OPENCLAW_TEST_FAST", "1");
|
||||
piEmbeddedMock.abortEmbeddedPiRun.mockReset().mockReturnValue(false);
|
||||
piEmbeddedMock.queueEmbeddedPiMessage.mockReset().mockReturnValue(false);
|
||||
piEmbeddedMock.isEmbeddedPiRunActive.mockReset().mockReturnValue(false);
|
||||
piEmbeddedMock.isEmbeddedPiRunStreaming.mockReset().mockReturnValue(false);
|
||||
piEmbeddedMock.abortEmbeddedPiRun.mockClear().mockReturnValue(false);
|
||||
piEmbeddedMock.queueEmbeddedPiMessage.mockClear().mockReturnValue(false);
|
||||
piEmbeddedMock.isEmbeddedPiRunActive.mockClear().mockReturnValue(false);
|
||||
piEmbeddedMock.isEmbeddedPiRunStreaming.mockClear().mockReturnValue(false);
|
||||
piEmbeddedMock.runEmbeddedPiAgent.mockReset();
|
||||
vi.mocked(loadModelCatalog).mockResolvedValue([
|
||||
{ id: "claude-opus-4-5", name: "Opus 4.5", provider: "anthropic" },
|
||||
|
||||
@@ -135,8 +135,8 @@ describe("/focus, /unfocus, /agents", () => {
|
||||
beforeEach(() => {
|
||||
resetSubagentRegistryForTests();
|
||||
hoisted.callGatewayMock.mockReset();
|
||||
hoisted.getThreadBindingManagerMock.mockReset();
|
||||
hoisted.resolveThreadBindingThreadNameMock.mockReset().mockReturnValue("🤖 codex");
|
||||
hoisted.getThreadBindingManagerMock.mockClear().mockReturnValue(null);
|
||||
hoisted.resolveThreadBindingThreadNameMock.mockClear().mockReturnValue("🤖 codex");
|
||||
});
|
||||
|
||||
it("/focus resolves ACP sessions and binds the current Discord thread", async () => {
|
||||
|
||||
@@ -65,11 +65,11 @@ beforeEach(async () => {
|
||||
testConfig = {};
|
||||
await setRegistry(createTestRegistry([]));
|
||||
callGatewayMock.mockReset();
|
||||
webAuthExists.mockReset().mockResolvedValue(false);
|
||||
handleDiscordAction.mockReset();
|
||||
handleSlackAction.mockReset();
|
||||
handleTelegramAction.mockReset();
|
||||
handleWhatsAppAction.mockReset();
|
||||
webAuthExists.mockClear().mockResolvedValue(false);
|
||||
handleDiscordAction.mockClear();
|
||||
handleSlackAction.mockClear();
|
||||
handleTelegramAction.mockClear();
|
||||
handleWhatsAppAction.mockClear();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user