-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
47 additions
and
42 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
18 changes: 7 additions & 11 deletions
18
vok-framework-vokdb/src/test/kotlin/eu/vaadinonkotlin/vaadin/vokdb/HasDataViewUtilsTest.kt
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 |
---|---|---|
@@ -1,24 +1,20 @@ | ||
package eu.vaadinonkotlin.vaadin.vokdb | ||
|
||
import com.github.mvysny.dynatest.DynaTest | ||
import com.github.mvysny.karibudsl.v10.grid | ||
import com.github.mvysny.kaributesting.v10.MockVaadin | ||
import com.github.mvysny.kaributesting.v10._findAll | ||
import com.vaadin.flow.component.UI | ||
import org.junit.jupiter.api.Nested | ||
import org.junit.jupiter.api.Test | ||
import kotlin.test.expect | ||
|
||
class HasDataViewUtilsTest : DynaTest({ | ||
group("API test: populating components with data providers") { | ||
usingH2Database() | ||
beforeEach { MockVaadin.setup() } | ||
afterEach { MockVaadin.tearDown() } | ||
|
||
group("grid") { | ||
test("entity data provider") { | ||
class HasDataViewUtilsTest { | ||
@Nested inner class `API test - populating components with data providers`() : AbstractVaadinDbTest() { | ||
@Nested inner class GridTests { | ||
@Test fun `entity data provider`() { | ||
(0..10).forEach { Person(null, "foo $it", it).save() } | ||
val cb = UI.getCurrent().grid<Person>(Person.dataProvider) {} | ||
expect((0..10).map { "foo $it" }) { cb._findAll().map { it.personName } } | ||
} | ||
} | ||
} | ||
}) | ||
} |