Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Compose Playground
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Briar Staging
Compose Playground
Commits
ab937a97
Commit
ab937a97
authored
4 years ago
by
Shagen Ogandzhanian
Browse files
Options
Downloads
Patches
Plain Diff
Introduce test for testing "raw" element creaation
parent
72a8a5b2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/core/src/jsTest/kotlin/elements/ElementsTests.kt
+45
-0
45 additions, 0 deletions
web/core/src/jsTest/kotlin/elements/ElementsTests.kt
with
45 additions
and
0 deletions
web/core/src/jsTest/kotlin/elements/ElementsTests.kt
0 → 100644
+
45
−
0
View file @
ab937a97
/*
* 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
<
Tag
.
Div
>.()
->
Unit
,
content
:
ContentBuilder
<
HTMLElement
>?
=
null
)
{
TagElement
<
Tag
.
Div
,
HTMLElement
>(
tagName
=
"custom"
,
applyAttrs
=
attrs
,
content
)
}
composition
{
CustomElement
({
id
(
"container"
)
})
{
Text
(
"CUSTOM"
)
}
}
assertEquals
(
"<div><custom id=\"container\">CUSTOM</custom></div>"
,
root
.
outerHTML
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment