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', () => {
describe('form fields', () => {
describe('form field "pushProtectedUpToAccessLevelSelect"', () => {
it('contains only valid options', () => {
mountComponent();
expect(findPushProtectedUpToAccessLevelSelect().exists()).toBe(true);
const pushProtectedUpToAccessLevelSelectOptions = findPushProtectedUpToAccessLevelSelect()
const pushProtectedUpToAccessLevelSelectOptions = () =>
findPushProtectedUpToAccessLevelSelect()
.findAll('option')
.wrappers.map((option) => option.element.value);
expect(pushProtectedUpToAccessLevelSelectOptions).toEqual([
'DEVELOPER',
'MAINTAINER',
'OWNER',
]);
});
it.each(['DEVELOPER', 'MAINTAINER', 'OWNER'])(
'includes the %s access level',
(accessLevel) => {
mountComponent();
expect(findPushProtectedUpToAccessLevelSelect().exists()).toBe(true);
expect(pushProtectedUpToAccessLevelSelectOptions()).toContain(accessLevel);
},
);
});
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