diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 21:09:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 21:09:46 +0000 |
commit | 8a7aaf86831d2a556578ae558a4fcab8bb659b20 (patch) | |
tree | 61c2b55aa48ff8e853e546cd3009dfc5423279c8 /spec/frontend/lib | |
parent | 967812838c7e7742729a4c7aeb9859f98a509622 (diff) | |
download | gitlab-ce-8a7aaf86831d2a556578ae558a4fcab8bb659b20.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/lib')
-rw-r--r-- | spec/frontend/lib/utils/common_utils_spec.js | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/spec/frontend/lib/utils/common_utils_spec.js b/spec/frontend/lib/utils/common_utils_spec.js index 6ba8f58086a..1edfda30fec 100644 --- a/spec/frontend/lib/utils/common_utils_spec.js +++ b/spec/frontend/lib/utils/common_utils_spec.js @@ -359,31 +359,16 @@ describe('common_utils', () => { }); describe('parseBoolean', () => { - const { parseBoolean } = commonUtils; - - it('returns true for "true"', () => { - expect(parseBoolean('true')).toEqual(true); - }); - - it('returns false for "false"', () => { - expect(parseBoolean('false')).toEqual(false); - }); - - it('returns false for "something"', () => { - expect(parseBoolean('something')).toEqual(false); - }); - - it('returns false for null', () => { - expect(parseBoolean(null)).toEqual(false); - }); - - it('is idempotent', () => { - const input = ['true', 'false', 'something', null]; - input.forEach(value => { - const result = parseBoolean(value); - - expect(parseBoolean(result)).toBe(result); - }); + it.each` + input | expected + ${'true'} | ${true} + ${'false'} | ${false} + ${'something'} | ${false} + ${null} | ${false} + ${true} | ${true} + ${false} | ${false} + `('returns $expected for $input', ({ input, expected }) => { + expect(commonUtils.parseBoolean(input)).toBe(expected); }); }); |