-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9568734
commit 09a9879
Showing
5 changed files
with
188 additions
and
98 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 was deleted.
Oops, something went wrong.
138 changes: 138 additions & 0 deletions
138
src/stories/tests-factory/create-smoke-scenarios.test.ts
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,138 @@ | ||
import {createSmokeScenarios} from './create-smoke-scenarios'; | ||
|
||
test('regular', () => { | ||
const smokeScenarious = createSmokeScenarios( | ||
{ | ||
theme: 'theme-1', | ||
label: 'label-1', | ||
}, | ||
{ | ||
theme: ['theme-2', 'theme-3'], | ||
label: ['label-2', 'label-3'], | ||
}, | ||
); | ||
|
||
expect(smokeScenarious).toEqual([ | ||
[ | ||
'smoke', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-1', | ||
theme: 'theme-1', | ||
}, | ||
], | ||
[ | ||
'smoke-theme-theme-2', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-1', | ||
theme: 'theme-2', | ||
}, | ||
], | ||
[ | ||
'smoke-theme-theme-3', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-1', | ||
theme: 'theme-3', | ||
}, | ||
], | ||
[ | ||
'smoke-label-label-2', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-2', | ||
theme: 'theme-1', | ||
}, | ||
], | ||
[ | ||
'smoke-label-label-3', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-3', | ||
theme: 'theme-1', | ||
}, | ||
], | ||
]); | ||
}); | ||
|
||
test('with scenario name', () => { | ||
const smokeScenarious = createSmokeScenarios( | ||
{ | ||
theme: 'theme-1', | ||
label: 'label-1', | ||
}, | ||
{ | ||
theme: [ | ||
['name-theme-2', 'theme-2'], | ||
['name-theme-3', 'theme-3'], | ||
], | ||
label: [ | ||
['name-label-2', 'label-2'], | ||
['name-label-3', 'label-3'], | ||
], | ||
}, | ||
); | ||
|
||
expect(smokeScenarious).toEqual([ | ||
[ | ||
'smoke', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-1', | ||
theme: 'theme-1', | ||
}, | ||
], | ||
[ | ||
'smoke-theme-name-theme-2', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-1', | ||
theme: 'theme-2', | ||
}, | ||
], | ||
[ | ||
'smoke-theme-name-theme-3', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-1', | ||
theme: 'theme-3', | ||
}, | ||
], | ||
[ | ||
'smoke-label-name-label-2', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-2', | ||
theme: 'theme-1', | ||
}, | ||
], | ||
[ | ||
'smoke-label-name-label-3', | ||
{tag: ['@smoke']}, | ||
{ | ||
label: 'label-3', | ||
theme: 'theme-1', | ||
}, | ||
], | ||
]); | ||
}); | ||
|
||
test('with additionalTags option', () => { | ||
const smokeScenarious = createSmokeScenarios( | ||
{ | ||
theme: 'theme-1', | ||
}, | ||
{ | ||
theme: [['name-theme-2', 'theme-2']], | ||
}, | ||
{ | ||
additionalTags: ['@custom-tag-1'], | ||
}, | ||
); | ||
|
||
expect(smokeScenarious).toEqual([ | ||
['smoke', {tag: ['@smoke', '@custom-tag-1']}, {theme: 'theme-1'}], | ||
['smoke-theme-name-theme-2', {tag: ['@smoke', '@custom-tag-1']}, {theme: 'theme-2'}], | ||
]); | ||
}); |
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