diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-08 06:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-08 06:09:21 +0300 |
commit | 4ec82c35f26a370589b7dd5fa9ca6ee4a079c62b (patch) | |
tree | 7fed6790d2b809c74e2931055256898cb631225d /spec/frontend/boards/components | |
parent | 5487465d35110ef72c2e7cea7ef031c3ddf4dcbc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/boards/components')
-rw-r--r-- | spec/frontend/boards/components/board_card_spec.js | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/spec/frontend/boards/components/board_card_spec.js b/spec/frontend/boards/components/board_card_spec.js index aad89cf8261..17a5383a31e 100644 --- a/spec/frontend/boards/components/board_card_spec.js +++ b/spec/frontend/boards/components/board_card_spec.js @@ -6,7 +6,7 @@ import Vuex from 'vuex'; import BoardCard from '~/boards/components/board_card.vue'; import BoardCardInner from '~/boards/components/board_card_inner.vue'; import { inactiveId } from '~/boards/constants'; -import { mockLabelList, mockIssue } from '../mock_data'; +import { mockLabelList, mockIssue, DEFAULT_COLOR } from '../mock_data'; describe('Board card', () => { let wrapper; @@ -180,4 +180,40 @@ describe('Board card', () => { expect(wrapper.classes()).toContain('gl-cursor-grab'); }); }); + + describe('when Epic colors are enabled', () => { + it('applies the correct color', () => { + window.gon.features = { epicColorHighlight: true }; + createStore(); + mountComponent({ + item: { + ...mockIssue, + color: DEFAULT_COLOR, + }, + }); + + expect(wrapper.classes()).toEqual( + expect.arrayContaining(['gl-pl-4', 'gl-border-l-solid', 'gl-border-4']), + ); + expect(wrapper.attributes('style')).toContain(`border-color: ${DEFAULT_COLOR}`); + }); + }); + + describe('when Epic colors are not enabled', () => { + it('applies the correct color', () => { + window.gon.features = { epicColorHighlight: false }; + createStore(); + mountComponent({ + item: { + ...mockIssue, + color: DEFAULT_COLOR, + }, + }); + + expect(wrapper.classes()).not.toEqual( + expect.arrayContaining(['gl-pl-4', 'gl-border-l-solid', 'gl-border-4']), + ); + expect(wrapper.attributes('style')).toBeUndefined(); + }); + }); }); |