actions-on-google / assistant-conversation-testing-nodejs

Assistant conversation testing library
Apache License 2.0
21 stars 16 forks source link

Assertion of the matched intents #19

Open oboznyiM opened 3 years ago

oboznyiM commented 3 years ago

I think, there is a typo in the implementation of assertTopMatchedIntent() method: async assertTopMatchedIntent( query: string, expectedIntent: string, requiredPlace = 1, queryLanguage: string )

According to the documentation, it checks if the expectedIntent is among top requiredPlace matched intents. Here's a line from the implementation of this method (src/action-on-google-test-manager.ts): !matchedIntents!.slice(0, requiredPlace - 1).includes(expectedIntent) It takes a slice from 0 to requiredPlace - 1 which is top (requiredPlace - 1) matched intents.

I faced this problem while testing a phrase that can be matched only to one intent.