@@ -13,8 +13,8 @@ describe('Check the contents returned by the plugin when match a smart intent',
13
13
14
14
beforeEach ( ( ) => mockSmartIntent ( 'Add a bag' ) )
15
15
16
- test ( 'When the smart intent inference returns the intent_name Add a Bag , the contents of the add a bag use case are displayed' , async ( ) => {
17
- const { contents } = await createFlowBuilderPluginAndGetContents ( {
16
+ test ( 'When the smart intent inference returns the intent_name Add a bag , the contents of the add a bag use case are displayed' , async ( ) => {
17
+ const { contents, request } = await createFlowBuilderPluginAndGetContents ( {
18
18
flowBuilderOptions : { flow : smartIntentsFlow } ,
19
19
requestArgs : {
20
20
input : {
@@ -27,6 +27,10 @@ describe('Check the contents returned by the plugin when match a smart intent',
27
27
expect ( ( contents [ 0 ] as FlowText ) . text ) . toBe (
28
28
'Message explaining how to add a bag'
29
29
)
30
+ expect ( request . input . nluResult ) . toEqual ( {
31
+ type : 'smart-intent' ,
32
+ match : 'Add a bag' ,
33
+ } )
30
34
} )
31
35
} )
32
36
@@ -36,7 +40,7 @@ describe('Check the contents returned by the plugin when no match a smart intent
36
40
beforeEach ( ( ) => mockSmartIntent ( 'Other' ) )
37
41
38
42
test ( 'When the smart intent inference returns the intent_name Other, fallback content are displayed' , async ( ) => {
39
- const { contents } = await createFlowBuilderPluginAndGetContents ( {
43
+ const { contents, request } = await createFlowBuilderPluginAndGetContents ( {
40
44
flowBuilderOptions : { flow : smartIntentsFlow } ,
41
45
requestArgs : {
42
46
input : {
@@ -47,5 +51,6 @@ describe('Check the contents returned by the plugin when no match a smart intent
47
51
} )
48
52
49
53
expect ( ( contents [ 0 ] as FlowText ) . text ) . toBe ( 'fallback 1st message' )
54
+ expect ( request . input . nluResult ) . toEqual ( undefined )
50
55
} )
51
56
} )
0 commit comments