hi
when I make a unit test with Intent inside State, it’s doesn’t work
async LAUNCH() {
this.$session.$data.index = 0;
this.$session.$data.sapEvent = this.$data.eventoo;
this.$session.$data.event_index = this.$data.eventoo.data.map(
(x) => x.externalId
);
let speech =
"bienvenue sur SAP, on vous propose : " +
this.$data.eventoo.data[0].title;
let reprompt = "nom d une sortie ou une categorie.";
this.followUpState('eventState').ask(speech, reprompt);
},
eventState: {
YesIntent() {
const index = this.$session.$data.index ? this.$session.$data.index : 0;
const next = "voulez vous voir la prop suivante ?";
let speech = getDescription(this, index);
this.ask(speech, "ou pas");
},
},
how to tested this ?
now it return undefined
it('should says abstract', async () => {
const description = events.description(0);
const yesintent = await testSuite.requestBuilder.intent('YesIntent');
const response = await conversation.send(yesintent);
console.log(response.getSpeechPlain()) <-- undefined