From 36e363d33d5f75aeb75c552d4b325ed8c2d6105f Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 21 Jan 2020 21:08:54 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/frontend/boards/boards_store_spec.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'spec/frontend/boards/boards_store_spec.js') diff --git a/spec/frontend/boards/boards_store_spec.js b/spec/frontend/boards/boards_store_spec.js index bf3d81d3117..2dc9039bc9d 100644 --- a/spec/frontend/boards/boards_store_spec.js +++ b/spec/frontend/boards/boards_store_spec.js @@ -6,7 +6,7 @@ import eventHub from '~/boards/eventhub'; import { listObj, listObjDuplicate } from './mock_data'; import ListIssue from '~/boards/models/issue'; -import '~/boards/models/list'; +import List from '~/boards/models/list'; jest.mock('js-cookie'); @@ -190,6 +190,30 @@ describe('boardsStore', () => { }); }); + describe('saveList', () => { + let list; + + beforeEach(() => { + list = new List(listObj); + setupDefaultResponses(); + }); + + it('makes a request to save a list', () => { + const expectedResponse = expect.objectContaining({ issues: [createTestIssue()] }); + const expectedListValue = { + id: listObj.id, + position: listObj.position, + type: listObj.list_type, + label: listObj.label, + }; + expect(list.id).toBe(listObj.id); + expect(list.position).toBe(listObj.position); + expect(list).toMatchObject(expectedListValue); + + return expect(boardsStore.saveList(list)).resolves.toEqual(expectedResponse); + }); + }); + describe('getIssuesForList', () => { const id = 'TOO-MUCH'; const url = `${endpoints.listsEndpoint}/${id}/issues?id=${id}`; -- cgit v1.2.1