summaryrefslogtreecommitdiff
path: root/tests/units/TaskPositionTest.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-31 13:47:47 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-31 13:47:47 -0500
commit27f453707948daf08e4a38c4c22e637a7ad0c57d (patch)
treeec0d2509b007f4f438a79c8af6e1c6519875d6e9 /tests/units/TaskPositionTest.php
parent198f8d6a8e39fe7bb21faafe53b12e351feca8b7 (diff)
Fix bug tasks don't show up on board/swimlanes
Diffstat (limited to 'tests/units/TaskPositionTest.php')
-rw-r--r--tests/units/TaskPositionTest.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/units/TaskPositionTest.php b/tests/units/TaskPositionTest.php
index 21f1fd62..ca7b3bf2 100644
--- a/tests/units/TaskPositionTest.php
+++ b/tests/units/TaskPositionTest.php
@@ -396,6 +396,7 @@ class TaskPositionTest extends Base
$this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(4, $tc->create(array('title' => 'Task #4', 'project_id' => 1, 'column_id' => 1)));
+ $this->assertEquals(5, $tc->create(array('title' => 'Task #5', 'project_id' => 1, 'column_id' => 1)));
// Move the task to the swimlane
$this->assertTrue($tp->movePosition(1, 1, 2, 1, 1));
@@ -452,6 +453,40 @@ class TaskPositionTest extends Base
$this->assertEquals(1, $task['column_id']);
$this->assertEquals(2, $task['position']);
$this->assertEquals(0, $task['swimlane_id']);
+
+ // Move the task 5 to the last column
+ $this->assertTrue($tp->movePosition(1, 5, 4, 1, 0));
+
+ // Check tasks position
+ $task = $tf->getById(1);
+ $this->assertEquals(1, $task['id']);
+ $this->assertEquals(2, $task['column_id']);
+ $this->assertEquals(2, $task['position']);
+ $this->assertEquals(1, $task['swimlane_id']);
+
+ $task = $tf->getById(2);
+ $this->assertEquals(2, $task['id']);
+ $this->assertEquals(2, $task['column_id']);
+ $this->assertEquals(1, $task['position']);
+ $this->assertEquals(1, $task['swimlane_id']);
+
+ $task = $tf->getById(3);
+ $this->assertEquals(3, $task['id']);
+ $this->assertEquals(1, $task['column_id']);
+ $this->assertEquals(1, $task['position']);
+ $this->assertEquals(0, $task['swimlane_id']);
+
+ $task = $tf->getById(4);
+ $this->assertEquals(4, $task['id']);
+ $this->assertEquals(1, $task['column_id']);
+ $this->assertEquals(2, $task['position']);
+ $this->assertEquals(0, $task['swimlane_id']);
+
+ $task = $tf->getById(5);
+ $this->assertEquals(5, $task['id']);
+ $this->assertEquals(4, $task['column_id']);
+ $this->assertEquals(1, $task['position']);
+ $this->assertEquals(0, $task['swimlane_id']);
}
public function testEvents()