diff --git a/web/core/src/jsTest/kotlin/elements/ElementsTests.kt b/web/core/src/jsTest/kotlin/elements/ElementsTests.kt new file mode 100644 index 0000000000..ef71b59df7 --- /dev/null +++ b/web/core/src/jsTest/kotlin/elements/ElementsTests.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. + * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. + */ + +package org.jetbrains.compose.web.core.tests.elements + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.attributes.AttrsBuilder +import org.jetbrains.compose.web.attributes.Tag +import org.jetbrains.compose.web.core.tests.runTest +import org.jetbrains.compose.web.dom.ContentBuilder +import org.jetbrains.compose.web.dom.TagElement +import org.jetbrains.compose.web.dom.Text +import org.w3c.dom.HTMLElement +import kotlin.test.Test +import kotlin.test.assertEquals + + +class ElementsTests { + @Test + fun rawCreation() = runTest { + @Composable + fun CustomElement( + attrs: AttrsBuilder.() -> Unit, + content: ContentBuilder? = null + ) { + TagElement( + tagName = "custom", + applyAttrs = attrs, + content + ) + } + + composition { + CustomElement({ + id("container") + }) { + Text("CUSTOM") + } + } + + assertEquals("
CUSTOM
", root.outerHTML) + } +} \ No newline at end of file