From f666026d71ebefd70219d5078b1f0c83fa01f84d Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Wed, 17 Oct 2018 02:13:26 -0500 Subject: Prettify all spec files --- spec/javascripts/boards/list_spec.js | 90 +++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 38 deletions(-) (limited to 'spec/javascripts/boards/list_spec.js') diff --git a/spec/javascripts/boards/list_spec.js b/spec/javascripts/boards/list_spec.js index 667fb710062..0d462a6f872 100644 --- a/spec/javascripts/boards/list_spec.js +++ b/spec/javascripts/boards/list_spec.js @@ -31,21 +31,21 @@ describe('List model', () => { mock.restore(); }); - it('gets issues when created', (done) => { + it('gets issues when created', done => { setTimeout(() => { expect(list.issues.length).toBe(1); done(); }, 0); }); - it('saves list and returns ID', (done) => { + it('saves list and returns ID', done => { list = new List({ title: 'test', label: { id: _.random(10000), title: 'test', - color: 'red' - } + color: 'red', + }, }); list.save(); @@ -57,7 +57,7 @@ describe('List model', () => { }, 0); }); - it('destroys the list', (done) => { + it('destroys the list', done => { boardsStore.addList(listObj); list = boardsStore.findList('id', listObj.id); @@ -70,7 +70,7 @@ describe('List model', () => { }, 0); }); - it('gets issue from list', (done) => { + it('gets issue from list', done => { setTimeout(() => { const issue = list.findIssue(1); @@ -79,7 +79,7 @@ describe('List model', () => { }, 0); }); - it('removes issue', (done) => { + it('removes issue', done => { setTimeout(() => { const issue = list.findIssue(1); @@ -109,8 +109,13 @@ describe('List model', () => { listDup.updateIssueLabel(issue, list); - expect(gl.boardService.moveIssue) - .toHaveBeenCalledWith(issue.id, list.id, listDup.id, undefined, undefined); + expect(gl.boardService.moveIssue).toHaveBeenCalledWith( + issue.id, + list.id, + listDup.id, + undefined, + undefined, + ); }); describe('page number', () => { @@ -120,14 +125,16 @@ describe('List model', () => { it('increase page number if current issue count is more than the page size', () => { for (let i = 0; i < 30; i += 1) { - list.issues.push(new ListIssue({ - title: 'Testing', - id: _.random(10000) + i, - iid: _.random(10000) + i, - confidential: false, - labels: [list.label], - assignees: [], - })); + list.issues.push( + new ListIssue({ + title: 'Testing', + id: _.random(10000) + i, + iid: _.random(10000) + i, + confidential: false, + labels: [list.label], + assignees: [], + }), + ); } list.issuesSize = 50; @@ -140,13 +147,15 @@ describe('List model', () => { }); it('does not increase page number if issue count is less than the page size', () => { - list.issues.push(new ListIssue({ - title: 'Testing', - id: _.random(10000), - confidential: false, - labels: [list.label], - assignees: [], - })); + list.issues.push( + new ListIssue({ + title: 'Testing', + id: _.random(10000), + confidential: false, + labels: [list.label], + assignees: [], + }), + ); list.issuesSize = 2; list.nextPage(); @@ -158,21 +167,25 @@ describe('List model', () => { describe('newIssue', () => { beforeEach(() => { - spyOn(gl.boardService, 'newIssue').and.returnValue(Promise.resolve({ - data: { - id: 42, - }, - })); + spyOn(gl.boardService, 'newIssue').and.returnValue( + Promise.resolve({ + data: { + id: 42, + }, + }), + ); }); - it('adds new issue to top of list', (done) => { - list.issues.push(new ListIssue({ - title: 'Testing', - id: _.random(10000), - confidential: false, - labels: [list.label], - assignees: [], - })); + it('adds new issue to top of list', done => { + list.issues.push( + new ListIssue({ + title: 'Testing', + id: _.random(10000), + confidential: false, + labels: [list.label], + assignees: [], + }), + ); const dummyIssue = new ListIssue({ title: 'new issue', id: _.random(10000), @@ -181,7 +194,8 @@ describe('List model', () => { assignees: [], }); - list.newIssue(dummyIssue) + list + .newIssue(dummyIssue) .then(() => { expect(list.issues.length).toBe(2); expect(list.issues[0]).toBe(dummyIssue); -- cgit v1.2.3