-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement tests on text reply with additions
- Loading branch information
fletcherist
committed
Aug 14, 2018
1 parent
03d3f19
commit 791619c
Showing
5 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Reply } from '../dist'; | ||
import { getRandomText } from './testUtils'; | ||
|
||
describe('Alice Reply (static method) suite', () => { | ||
let text = ''; | ||
beforeEach(() => { | ||
text = getRandomText(); | ||
}); | ||
test('Text reply', () => { | ||
expect(Reply.text(text)).toEqual({ | ||
text: text, | ||
tts: text, | ||
end_session: false, | ||
}); | ||
}); | ||
test('Text reply with extra params', () => { | ||
const expected = { | ||
text: text, | ||
tts: text + '+', | ||
end_session: true, | ||
}; | ||
expect( | ||
Reply.text(expected.text, { tts: expected.tts, end_session: true }), | ||
).toEqual({ | ||
text: text, | ||
tts: expected.tts, | ||
end_session: true, | ||
}); | ||
}); | ||
}); |