Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Embedded.parameters for handling parameters, added propertyValu…
…eFormatter and other missing methods to Table, wrote some tests for TreeTable
- Loading branch information
Henri Kerola
committed
Jun 27, 2012
1 parent
41ea098
commit 448026f
Showing
6 changed files
with
219 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
addon/src/test/scala/vaadin/scala/tests/TreeTableTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package vaadin.scala.tests | ||
|
||
import vaadin.scala._ | ||
import org.scalatest.FunSuite | ||
import org.junit.runner.RunWith | ||
import org.scalatest.junit.JUnitRunner | ||
import org.scalatest.BeforeAndAfter | ||
import org.scalatest.mock.MockitoSugar | ||
import vaadin.scala.mixins.TreeTableMixin | ||
import org.mockito.Mockito | ||
|
||
@RunWith(classOf[JUnitRunner]) | ||
class TreeTableTests extends FunSuite with BeforeAndAfter with MockitoSugar { | ||
|
||
class VaadinTreeTable extends com.vaadin.ui.TreeTable with TreeTableMixin | ||
|
||
var treeTable: TreeTable = _ | ||
var spy: VaadinTreeTable = _ | ||
|
||
before { | ||
val vaadinTree = new VaadinTreeTable | ||
spy = Mockito.spy(vaadinTree) | ||
treeTable = new TreeTable(spy) | ||
} | ||
|
||
test("collapsed(itemId, collapsed)") { | ||
treeTable.collapsed('itemId, true) | ||
Mockito.verify(spy).setCollapsed('itemId, true) | ||
} | ||
|
||
test("hierarchyColumn") { | ||
assert(treeTable.hierarchyColumn === None) | ||
|
||
treeTable.hierarchyColumn = 'col1 | ||
assert(treeTable.hierarchyColumn === Some('col1)) | ||
|
||
treeTable.hierarchyColumn = None | ||
assert(treeTable.hierarchyColumn === None) | ||
|
||
treeTable.hierarchyColumn = Some('col1) | ||
assert(treeTable.hierarchyColumn === Some('col1)) | ||
} | ||
|
||
test("collapsed(itemId)") { | ||
assert(treeTable.collapsed('itemId)) | ||
Mockito.verify(spy).isCollapsed('itemId) | ||
} | ||
|
||
test("animationsEnabled") { | ||
assert(!treeTable.animationsEnabled) | ||
|
||
treeTable.animationsEnabled = true | ||
assert(treeTable.animationsEnabled) | ||
} | ||
} |