diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-21 09:06:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-21 09:06:32 +0300 |
commit | 80e5134020483299c039114e76b734436f006c66 (patch) | |
tree | c01e1b0451c336f2349cc7db9c9dc317b98bed54 /spec/javascripts/boards | |
parent | 8d78e95a9c5b352fb0498ca9c46d068eb93e6e27 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts/boards')
-rw-r--r-- | spec/javascripts/boards/board_list_spec.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/spec/javascripts/boards/board_list_spec.js b/spec/javascripts/boards/board_list_spec.js index 37e96e97279..b4e1d3b97b1 100644 --- a/spec/javascripts/boards/board_list_spec.js +++ b/spec/javascripts/boards/board_list_spec.js @@ -207,4 +207,56 @@ describe('Board list component', () => { .catch(done.fail); }); }); + + describe('max issue count warning', () => { + beforeEach(done => { + ({ mock, component } = createComponent({ + done, + listProps: { type: 'closed', collapsed: true, issuesSize: 50 }, + })); + }); + + afterEach(() => { + mock.restore(); + component.$destroy(); + }); + + describe('when issue count exceeds max issue count', () => { + it('sets background to bg-danger-100', done => { + component.list.issuesSize = 4; + component.list.maxIssueCount = 3; + + Vue.nextTick(() => { + expect(component.$el.querySelector('.bg-danger-100')).not.toBeNull(); + + done(); + }); + }); + }); + + describe('when list issue count does NOT exceed list max issue count', () => { + it('does not sets background to bg-danger-100', done => { + component.list.issuesSize = 2; + component.list.maxIssueCount = 3; + + Vue.nextTick(() => { + expect(component.$el.querySelector('.bg-danger-100')).toBeNull(); + + done(); + }); + }); + }); + + describe('when list max issue count is 0', () => { + it('does not sets background to bg-danger-100', done => { + component.list.maxIssueCount = 0; + + Vue.nextTick(() => { + expect(component.$el.querySelector('.bg-danger-100')).toBeNull(); + + done(); + }); + }); + }); + }); }); |