diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-02 15:18:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-02 15:18:53 +0300 |
commit | 51d59a3538b97d85ebb46039044d3f498809b55a (patch) | |
tree | d574af08cc1e2ef8fa8337a0850fa36a7b9ab527 /spec/frontend/lib | |
parent | 74da249f7e22c20e144ba3c044c6bdeb5df86cd4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/lib')
-rw-r--r-- | spec/frontend/lib/utils/color_utils_spec.js | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/spec/frontend/lib/utils/color_utils_spec.js b/spec/frontend/lib/utils/color_utils_spec.js index a5580a3d8d6..92ac66c19f0 100644 --- a/spec/frontend/lib/utils/color_utils_spec.js +++ b/spec/frontend/lib/utils/color_utils_spec.js @@ -1,44 +1,6 @@ -import { - isValidColorExpression, - textColorForBackground, - hexToRgb, - validateHexColor, - darkModeEnabled, -} from '~/lib/utils/color_utils'; +import { isValidColorExpression, validateHexColor, darkModeEnabled } from '~/lib/utils/color_utils'; describe('Color utils', () => { - describe('Converting hex code to rgb', () => { - it('convert hex code to rgb', () => { - expect(hexToRgb('#000000')).toEqual([0, 0, 0]); - expect(hexToRgb('#ffffff')).toEqual([255, 255, 255]); - }); - - it('convert short hex code to rgb', () => { - expect(hexToRgb('#000')).toEqual([0, 0, 0]); - expect(hexToRgb('#fff')).toEqual([255, 255, 255]); - }); - - it('handle conversion regardless of the characters case', () => { - expect(hexToRgb('#f0F')).toEqual([255, 0, 255]); - }); - }); - - describe('Getting text color for given background', () => { - // following tests are being ported from `text_color_for_bg` section in labels_helper_spec.rb - it('uses light text on dark backgrounds', () => { - expect(textColorForBackground('#222E2E')).toEqual('#FFFFFF'); - }); - - it('uses dark text on light backgrounds', () => { - expect(textColorForBackground('#EEEEEE')).toEqual('#333333'); - }); - - it('supports RGB triplets', () => { - expect(textColorForBackground('#FFF')).toEqual('#333333'); - expect(textColorForBackground('#000')).toEqual('#FFFFFF'); - }); - }); - describe('Validate hex color', () => { it.each` color | output |