From fee629d8cd8b49290564f31a06b9cc86ba12a702 Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Tue, 3 Dec 2024 11:28:23 +0530 Subject: [PATCH] fixed test cases --- .../__snapshots__/message-parser.spec.ts.snap | 18 ++++++++++++++++++ app/lib/runtime/message-parser.spec.ts | 6 +++++- app/lib/stores/workbench.ts | 2 +- app/types/artifact.ts | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/lib/runtime/__snapshots__/message-parser.spec.ts.snap b/app/lib/runtime/__snapshots__/message-parser.spec.ts.snap index 15437702..4b60f10b 100644 --- a/app/lib/runtime/__snapshots__/message-parser.spec.ts.snap +++ b/app/lib/runtime/__snapshots__/message-parser.spec.ts.snap @@ -29,6 +29,7 @@ exports[`StreamingMessageParser > valid artifacts with actions > should correctl "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -37,6 +38,7 @@ exports[`StreamingMessageParser > valid artifacts with actions > should correctl "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -96,6 +98,7 @@ exports[`StreamingMessageParser > valid artifacts with actions > should correctl "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -104,6 +107,7 @@ exports[`StreamingMessageParser > valid artifacts with actions > should correctl "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -112,6 +116,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -120,6 +125,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -128,6 +134,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": "bundled", } `; @@ -136,6 +143,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": "bundled", } `; @@ -144,6 +152,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -152,6 +161,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -160,6 +170,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -168,6 +179,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -176,6 +188,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -184,6 +197,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -192,6 +206,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -200,6 +215,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -208,6 +224,7 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; @@ -216,5 +233,6 @@ exports[`StreamingMessageParser > valid artifacts without actions > should corre "id": "artifact_1", "messageId": "message_1", "title": "Some title", + "type": undefined, } `; diff --git a/app/lib/runtime/message-parser.spec.ts b/app/lib/runtime/message-parser.spec.ts index 739604bc..4c5ba479 100644 --- a/app/lib/runtime/message-parser.spec.ts +++ b/app/lib/runtime/message-parser.spec.ts @@ -59,7 +59,11 @@ describe('StreamingMessageParser', () => { }, ], [ - ['Some text before foo Some more text'], + [ + 'Some text before foo Some more text', + ], { output: 'Some text before Some more text', callbacks: { onArtifactOpen: 1, onArtifactClose: 1, onActionOpen: 0, onActionClose: 0 }, diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index 8b13c7bd..de3a11eb 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -231,7 +231,7 @@ export class WorkbenchStore { // TODO: what do we wanna do and how do we wanna recover from this? } - addArtifact({ messageId, title, id,type }: ArtifactCallbackData) { + addArtifact({ messageId, title, id, type }: ArtifactCallbackData) { const artifact = this.#getArtifact(messageId); if (artifact) { diff --git a/app/types/artifact.ts b/app/types/artifact.ts index 660729ce..3a1e6b9f 100644 --- a/app/types/artifact.ts +++ b/app/types/artifact.ts @@ -1,5 +1,5 @@ export interface BoltArtifactData { id: string; title: string; - type?: string; + type?: string | undefined; }