-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cover LaunchIntent & ErrorHandler in test and cleanup Launch res…
…ponse
- Loading branch information
Showing
3 changed files
with
68 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { oneLine } from 'common-tags'; | ||
import fetch from 'supertest'; | ||
import { SERVER, setup, teardown } from './utils'; | ||
|
||
describe('LaunchIntent', () => { | ||
beforeAll(() => { | ||
setup(); | ||
}); | ||
|
||
afterAll(() => { | ||
teardown(); | ||
}); | ||
|
||
test('GIVEN Request to Launch THEN returns launch blurb', async () => { | ||
expect.assertions(2); | ||
|
||
const res = await fetch(SERVER) | ||
.post('/dexa') | ||
.send({ | ||
request: { | ||
type: 'LaunchRequest' | ||
} | ||
}); | ||
|
||
const { ssml } = res.body.response.outputSpeech; | ||
|
||
expect(res.status).toBe(200); | ||
expect(ssml).toBe(oneLine` | ||
<speak>Welcome to Dexa, your one stop place for PokéDex information. | ||
You can start browsing right away by giving me a command, or respond with \"help\" to learn all my commands. | ||
If you want to stop Dexa, then respond with \"Alexa Stop\".</speak> | ||
`); | ||
}); | ||
}); |
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