diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-25 15:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-25 15:09:19 +0300 |
commit | a156fc95eb8499fec9cd081d30629f0faf18bfe9 (patch) | |
tree | ff59d44794ba9d8084e4d59057ec9507b3ba8e2f /spec/frontend/issues_list | |
parent | 618be8f52d6349533c709a1d702e45b84338c36a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/issues_list')
-rw-r--r-- | spec/frontend/issues_list/components/issues_list_app_spec.js | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/spec/frontend/issues_list/components/issues_list_app_spec.js b/spec/frontend/issues_list/components/issues_list_app_spec.js index 0a445973c14..20644f80bf6 100644 --- a/spec/frontend/issues_list/components/issues_list_app_spec.js +++ b/spec/frontend/issues_list/components/issues_list_app_spec.js @@ -13,6 +13,7 @@ import { sortOptions, sortParams, } from '~/issues_list/constants'; +import eventHub from '~/issues_list/eventhub'; import axios from '~/lib/utils/axios_utils'; import { setUrlParams } from '~/lib/utils/url_utility'; @@ -101,6 +102,23 @@ describe('IssuesListApp component', () => { }); }); + describe('bulk edit', () => { + describe.each([true, false])( + 'when "issuables:toggleBulkEdit" event is received with payload `%s`', + (isBulkEdit) => { + beforeEach(() => { + wrapper = mountComponent(); + + eventHub.$emit('issuables:toggleBulkEdit', isBulkEdit); + }); + + it(`${isBulkEdit ? 'enables' : 'disables'} bulk edit`, () => { + expect(findIssuableList().props('showBulkEditSidebar')).toBe(isBulkEdit); + }); + }, + ); + }); + describe('when "page-change" event is emitted by IssuableList', () => { const data = [{ id: 10, title: 'title', state }]; const page = 2; @@ -119,7 +137,7 @@ describe('IssuesListApp component', () => { await waitForPromises(); }); - it('fetches issues with expected params', async () => { + it('fetches issues with expected params', () => { expect(axiosMock.history.get[1].params).toEqual({ page, per_page: PAGE_SIZE, @@ -192,7 +210,7 @@ describe('IssuesListApp component', () => { describe('when "sort" event is emitted by IssuableList', () => { it.each(Object.keys(sortParams))( - 'fetches issues with correct params for "sort" payload %s', + 'fetches issues with correct params for "sort" payload `%s`', async (sortKey) => { wrapper = mountComponent(); @@ -210,4 +228,19 @@ describe('IssuesListApp component', () => { }, ); }); + + describe('when "update-legacy-bulk-edit" event is emitted by IssuableList', () => { + beforeEach(() => { + wrapper = mountComponent(); + jest.spyOn(eventHub, '$emit'); + }); + + it('emits an "issuables:updateBulkEdit" event to the legacy bulk edit class', async () => { + findIssuableList().vm.$emit('update-legacy-bulk-edit'); + + await waitForPromises(); + + expect(eventHub.$emit).toHaveBeenCalledWith('issuables:updateBulkEdit'); + }); + }); }); |