summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-08-16 09:39:58 +0100
committerPhil Hughes <me@iamphill.com>2016-08-17 17:17:39 +0100
commit8d0ddbdb366cce8e4a5709619064d8a48f5014f3 (patch)
tree41f1070432eee62a5790f94ade5ece353b763bd6 /spec/javascripts
parentdc73405d6e682452379366d9652a403c1be2a77a (diff)
downloadgitlab-ce-8d0ddbdb366cce8e4a5709619064d8a48f5014f3.tar.gz
Updated rspec to not use sleep when dragging
Fixed JS tests
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/boards/boards_store_spec.js.es624
1 files changed, 10 insertions, 14 deletions
diff --git a/spec/javascripts/boards/boards_store_spec.js.es6 b/spec/javascripts/boards/boards_store_spec.js.es6
index b7923c85cec..078e4b00023 100644
--- a/spec/javascripts/boards/boards_store_spec.js.es6
+++ b/spec/javascripts/boards/boards_store_spec.js.es6
@@ -125,39 +125,35 @@
expect(gl.issueBoards.BoardsStore.state.lists.length).toBe(1);
- gl.issueBoards.BoardsStore.removeList(1);
+ gl.issueBoards.BoardsStore.removeList(1, 'label');
expect(gl.issueBoards.BoardsStore.state.lists.length).toBe(0);
});
it('moves the position of lists', () => {
- gl.issueBoards.BoardsStore.addList(listObj);
- gl.issueBoards.BoardsStore.addList(listObjDuplicate);
+ const listOne = gl.issueBoards.BoardsStore.addList(listObj),
+ listTwo = gl.issueBoards.BoardsStore.addList(listObjDuplicate);
expect(gl.issueBoards.BoardsStore.state.lists.length).toBe(2);
- gl.issueBoards.BoardsStore.moveList(0, 1);
+ gl.issueBoards.BoardsStore.moveList(listOne, ['2', '1']);
- const list = gl.issueBoards.BoardsStore.findList('id', 1);
- expect(list.position).toBe(1);
+ expect(listOne.position).toBe(1);
});
it('moves an issue from one list to another', (done) => {
- gl.issueBoards.BoardsStore.addList(listObj);
- gl.issueBoards.BoardsStore.addList(listObjDuplicate);
+ const listOne = gl.issueBoards.BoardsStore.addList(listObj),
+ listTwo = gl.issueBoards.BoardsStore.addList(listObjDuplicate);
expect(gl.issueBoards.BoardsStore.state.lists.length).toBe(2);
- const list = gl.issueBoards.BoardsStore.findList('id', 1),
- listTwo = gl.issueBoards.BoardsStore.findList('id', 2);
-
setTimeout(() => {
- expect(list.issues.length).toBe(1);
+ expect(listOne.issues.length).toBe(1);
expect(listTwo.issues.length).toBe(1);
- gl.issueBoards.BoardsStore.moveIssueToList(1, 2, 1);
+ gl.issueBoards.BoardsStore.moveIssueToList(listOne, listTwo, listOne.findIssue(1));
- expect(list.issues.length).toBe(0);
+ expect(listOne.issues.length).toBe(0);
expect(listTwo.issues.length).toBe(1);
done();