Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplified 'template' Cucumber tests. Updated docs. Simplified 'templ…
…ate' listing param handling.
- Loading branch information
1 parent
0bcab07
commit 94e06a3
Showing
16 changed files
with
150 additions
and
161 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 |
---|---|---|
@@ -1,17 +1,12 @@ | ||
|
||
Feature: the server receives a request to send a list of the available email templates | ||
|
||
Scenario Outline: list successfully the names of the generated email templates | ||
Given an authenticated identity in the app with <identity_id> | ||
Then a request for template listing is sent to <endpoint> yielding the list of templates in <response> | ||
Then a request for template listing is sent to <endpoint> yielding <response> | ||
|
||
Examples: | ||
| identity_id | endpoint | response | | ||
| identity_id | endpoint | response | | ||
| 01f0000000000000003f0001 | /api/notification/template/list | template/valid_template_list_response.js | | ||
| 01f0000000000000003f0001 | /api/notification/template/list | template/invalid_template_list_response.js | | ||
|
||
Scenario Outline: fail to list the names of the generated email templates | ||
Given an authenticated identity in the app with <identity_id> | ||
Then a request for template listing is sent to <endpoint> and fails yielding the error in <response> | ||
|
||
Examples: | ||
| identity_id | endpoint | response | | ||
| 01f0000000000000003f0001 | /api/notification/template/list | template/invalid_template_list_response.js | |
15 changes: 10 additions & 5 deletions
15
cucumber/test_files/template/invalid_template_creation_response.js
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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
'use strict'; | ||
|
||
const errors = require('../../../lib/util/errors'); | ||
|
||
module.exports = { | ||
status: 400, | ||
data: { | ||
error: new errors.BadRequestError('Creation error'), | ||
content: { | ||
output: 'done' | ||
stubbed: { | ||
error: new errors.BadRequestError('Missing or invalid parameters: content, filename, type'), | ||
output: undefined | ||
}, | ||
result: { | ||
status: 400, | ||
body: { | ||
code: 'BadRequestError', | ||
message: 'Missing or invalid parameters: content, filename, type' | ||
} | ||
} | ||
}; |
12 changes: 9 additions & 3 deletions
12
cucumber/test_files/template/invalid_template_details_response.js
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
status: 500, | ||
data: { | ||
stubbed: { | ||
error: { | ||
code: 'InternalError', | ||
message: 'Read error' | ||
}, | ||
content: undefined | ||
output: undefined | ||
}, | ||
result: { | ||
status: 500, | ||
body: { | ||
code: 'InternalError', | ||
message: 'Read error' | ||
} | ||
} | ||
}; |
14 changes: 11 additions & 3 deletions
14
cucumber/test_files/template/invalid_template_list_response.js
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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
'use strict'; | ||
|
||
const errors = require('../../../lib/util/errors'); | ||
|
||
module.exports = { | ||
status: 500, | ||
data: { | ||
stubbed: { | ||
error: { | ||
code: 'InternalError', | ||
message: 'Read error' | ||
}, | ||
content: undefined | ||
output: undefined | ||
}, | ||
result: { | ||
status: 500, | ||
body: { | ||
code: 'InternalError', | ||
message: 'Read error' | ||
} | ||
} | ||
}; |
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
11 changes: 8 additions & 3 deletions
11
cucumber/test_files/template/valid_template_creation_response.js
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
16 changes: 12 additions & 4 deletions
16
cucumber/test_files/template/valid_template_details_response.js
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
Oops, something went wrong.