diff --git a/packages/backend/server/tests/copilot.e2e.ts b/packages/backend/server/tests/copilot.e2e.ts index 78e4d6e9b5c91..cd1d9e5437fbe 100644 --- a/packages/backend/server/tests/copilot.e2e.ts +++ b/packages/backend/server/tests/copilot.e2e.ts @@ -7,9 +7,10 @@ import type { TestFn } from 'ava'; import ava from 'ava'; import Sinon from 'sinon'; -import { AppModule } from '../src/app.module'; import { AuthService } from '../src/core/auth'; +import { WorkspaceModule } from '../src/core/workspaces'; import { ConfigModule } from '../src/fundamentals/config'; +import { CopilotModule } from '../src/plugins/copilot'; import { PromptService } from '../src/plugins/copilot/prompt'; import { CopilotProviderService, @@ -45,7 +46,6 @@ const test = ava as TestFn<{ test.beforeEach(async t => { const { app } = await createTestingApp({ imports: [ - AppModule, ConfigModule.forRoot({ plugins: { copilot: { @@ -58,6 +58,8 @@ test.beforeEach(async t => { }, }, }), + WorkspaceModule, + CopilotModule, ], }); @@ -208,7 +210,7 @@ test('should be able to chat with api', async t => { const ret2 = await chatWithTextStream(app, token, sessionId, messageId); t.is( ret2, - textToEventStream('generate text to text stream', sessionId), + textToEventStream('generate text to text stream', messageId), 'should be able to chat with text stream' ); @@ -217,7 +219,7 @@ test('should be able to chat with api', async t => { ret3, textToEventStream( ['https://example.com/image.jpg'], - sessionId, + messageId, 'attachment' ), 'should be able to chat with images'