From ee1470ced22248a33b0fb646ae157889ef70ee4d Mon Sep 17 00:00:00 2001 From: Martin Vysny Date: Mon, 28 Oct 2024 14:00:13 +0200 Subject: [PATCH] replace dynatest with junit5 --- .../mvysny/kaributesting/v10/AllTests.kt | 4 +--- .../mvysny/kaributesting/v10/CompositeTest.kt | 20 +++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/AllTests.kt b/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/AllTests.kt index 1df87fda..554d21e9 100644 --- a/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/AllTests.kt +++ b/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/AllTests.kt @@ -46,6 +46,7 @@ open class AbstractAllTests10(val isModuleTest: Boolean) { @Nested inner class LitTemplateTests : AbstractLitTemplateTests(isModuleTest) @Nested inner class NpmTemplateTests : AbstractNpmPolymerTemplateTests(isModuleTest) @Nested inner class DialogTests : AbstractDialogTests() + @Nested inner class CompositeTests : AbstractCompositeTests() } /** @@ -58,9 +59,6 @@ fun DynaNodeGroup.allTests(isModuleTest: Boolean) { Locale.setDefault(Locale.ENGLISH) } - group("Composite") { - compositeTests() - } group("radio button") { radioButtonTests() } diff --git a/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/CompositeTest.kt b/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/CompositeTest.kt index 81dc3436..e85012ca 100644 --- a/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/CompositeTest.kt +++ b/karibu-testing-v10/kt10-tests/src/main/kotlin/com/github/mvysny/kaributesting/v10/CompositeTest.kt @@ -1,26 +1,26 @@ package com.github.mvysny.kaributesting.v10 -import com.github.mvysny.dynatest.DynaNodeGroup -import com.github.mvysny.dynatest.DynaTestDsl import com.vaadin.flow.component.Composite import com.vaadin.flow.component.button.Button import com.vaadin.flow.component.html.Div import com.vaadin.flow.component.orderedlayout.FlexLayout import com.vaadin.flow.component.orderedlayout.VerticalLayout +import org.junit.jupiter.api.AfterEach +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test -@DynaTestDsl -internal fun DynaNodeGroup.compositeTests() { - beforeEach { MockVaadin.setup() } - afterEach { MockVaadin.tearDown() } +abstract class AbstractCompositeTests() { + @BeforeEach fun fakeVaadin() { MockVaadin.setup() } + @AfterEach fun tearDownVaadin() { MockVaadin.tearDown() } - test("Composite