Skip to content

Commit 11297f8

Browse files
feat(SHAPE-8085): fix tests
1 parent d0e8573 commit 11297f8

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

packages/field-plugin/src/createFieldPlugin/createPluginActions/createPluginMessageListener/handlePluginMessage.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('handlePluginMessage', () => {
148148
action: 'prompt-ai',
149149
uid,
150150
callbackId: 'test-callback-id',
151-
output: 'Some output',
151+
aiGeneratedText: 'Some AI generated text',
152152
}
153153

154154
const callbacks = mockCallbacks()

packages/field-plugin/src/messaging/pluginMessage/containerToPluginMessage/PromptAIResponseMessage.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const stub: PromptAIResponseMessage = {
77
action: 'prompt-ai',
88
uid: '-preview',
99
callbackId: 'test-callback-id',
10-
output: 'test-output',
10+
aiGeneratedText: 'test-ai-generated-text',
1111
}
1212

1313
describe('PromptAIResponseMessage', function () {
@@ -30,50 +30,50 @@ describe('PromptAIResponseMessage', function () {
3030
).toEqual(false)
3131
})
3232
})
33-
describe('the output property', () => {
33+
describe('the aiGeneratedText property', () => {
3434
it('cannot be undefined', () => {
3535
expect(
3636
isPromptAIMessage({
3737
...stub,
38-
output: undefined,
38+
aiGeneratedText: undefined,
3939
}),
4040
).toEqual(false)
4141
})
4242
it('is a string', () => {
4343
expect(
4444
isPromptAIMessage({
4545
...stub,
46-
output: 'any-string',
46+
aiGeneratedText: 'any-string',
4747
}),
4848
).toEqual(true)
4949
expect(
5050
isPromptAIMessage({
5151
...stub,
52-
output: 123,
52+
aiGeneratedText: 123,
5353
}),
5454
).toEqual(false)
5555
expect(
5656
isPromptAIMessage({
5757
...stub,
58-
output: null,
58+
aiGeneratedText: null,
5959
}),
6060
).toEqual(false)
6161
expect(
6262
isPromptAIMessage({
6363
...stub,
64-
output: [],
64+
aiGeneratedText: [],
6565
}),
6666
).toEqual(false)
6767
expect(
6868
isPromptAIMessage({
6969
...stub,
70-
output: {},
70+
aiGeneratedText: {},
7171
}),
7272
).toEqual(false)
7373
expect(
7474
isPromptAIMessage({
7575
...stub,
76-
output: false,
76+
aiGeneratedText: false,
7777
}),
7878
).toEqual(false)
7979
})

packages/lib-helpers/test/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ const getContainer = (sendToFieldPlugin: (data: unknown) => void) => {
115115
action: 'prompt-ai',
116116
uid,
117117
callbackId: data.callbackId,
118-
output: 'output fake for the prompt: ' + data.payload.text,
118+
aiGeneratedText:
119+
'Fake AI generated text for the prompt: ' + data.payload.text,
119120
})
120121
} else if (isGetUserContextMessage(data)) {
121122
sendToFieldPlugin({

0 commit comments

Comments
 (0)