Skip to content

Commit 954a379

Browse files
committed
Using attributes of an underline html element
1 parent 36bd68a commit 954a379

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dom/src/test/scala/com/thoughtworks/binding/ComponentModel.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import org.scalajs.dom.html.Div
1010
class ComponentModel extends FreeSpec with Matchers {
1111

1212
"@dom method component" in {
13-
@dom def dialog: Binding[Div] = <div class="dialog"/>
13+
@dom def dialog(id: String): Binding[Div] = <div id={id} class="dialog"/>
1414

15-
@dom val html = <div>{dialog.bind}</div>
15+
@dom val html = <div>{dialog("message").bind}</div>
1616
html.watch()
1717

18-
assert(html.value.outerHTML == """<div><div class="dialog"/></div>""")
18+
assert(html.value.outerHTML == """<div><div class="dialog" id="message"/></div>""")
1919
}
2020

2121
"user defined tag component" in {
@@ -29,10 +29,10 @@ class ComponentModel extends FreeSpec with Matchers {
2929
}
3030
}
3131

32-
@dom val html = <div><dialog/></div>
32+
@dom val html = <div><dialog id="message"/></div>
3333
html.watch()
3434

35-
assert(html.value.outerHTML == """<div><div class="dialog"/></div>""")
35+
assert(html.value.outerHTML == """<div><div class="dialog" id="message"/></div>""")
3636
}
3737

3838
}

0 commit comments

Comments
 (0)