Skip to content
Snippets Groups Projects
Commit 45effae4 authored by Gerardo Navarro's avatar Gerardo Navarro :speech_balloon:
Browse files

refactor: Apply suggestion from @ekigbo

- Improve readability of tests
parent fcae524a
No related branches found
No related tags found
1 merge request!146523Protected containers: Create protection rules in project settings
...@@ -53,19 +53,20 @@ describe('container Protection Rule Form', () => { ...@@ -53,19 +53,20 @@ describe('container Protection Rule Form', () => {
describe('form fields', () => { describe('form fields', () => {
describe('form field "pushProtectedUpToAccessLevelSelect"', () => { describe('form field "pushProtectedUpToAccessLevelSelect"', () => {
it('contains only valid options', () => { const pushProtectedUpToAccessLevelSelectOptions = () =>
mountComponent(); findPushProtectedUpToAccessLevelSelect()
expect(findPushProtectedUpToAccessLevelSelect().exists()).toBe(true);
const pushProtectedUpToAccessLevelSelectOptions = findPushProtectedUpToAccessLevelSelect()
.findAll('option') .findAll('option')
.wrappers.map((option) => option.element.value); .wrappers.map((option) => option.element.value);
expect(pushProtectedUpToAccessLevelSelectOptions).toEqual([
'DEVELOPER', it.each(['DEVELOPER', 'MAINTAINER', 'OWNER'])(
'MAINTAINER', 'includes the %s access level',
'OWNER', (accessLevel) => {
]); mountComponent();
});
expect(findPushProtectedUpToAccessLevelSelect().exists()).toBe(true);
expect(pushProtectedUpToAccessLevelSelectOptions()).toContain(accessLevel);
},
);
}); });
describe('when graphql mutation is in progress', () => { describe('when graphql mutation is in progress', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment