forked from ThoughtWorksInc/Binding.scala
-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
133 additions
and
63 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
55 changes: 55 additions & 0 deletions
55
html/src/test/scala/com/thoughtwors/binding/html/Issue439Spec.scala
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.thoughtworks.binding | ||
package html | ||
import org.scalatest.freespec.AsyncFreeSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import com.thoughtworks.dsl.keywords.Await | ||
import com.thoughtworks.dsl.Dsl | ||
import com.thoughtworks.dsl.macros.Reset.Default.`*` | ||
import Binding.BindingSeq | ||
import bindable.BindableSeq | ||
import org.scalajs.dom.Node | ||
import scala.concurrent.Future | ||
import org.scalajs.dom.Element | ||
import org.scalajs.dom.document | ||
|
||
final class Issue439Spec extends AsyncFreeSpec with Matchers { | ||
|
||
"The content of element 1 is an argument; element 2 is empty" in { | ||
val children = html"<section>${"argument"}</section><footer></footer>" | ||
*[Future] { | ||
( | ||
for snapshot <- !Await(children.snapshots.toLazyList) | ||
yield { | ||
for node <- snapshot.toList | ||
yield node.asInstanceOf[Element].outerHTML | ||
}.mkString | ||
) should be( | ||
LazyList( | ||
"", | ||
"<section>argument</section>", | ||
"<section>argument</section><footer></footer>" | ||
) | ||
) | ||
} | ||
} | ||
|
||
"The content of element 1 is an argument and some more text; element 2 is empty" in { | ||
val children = html"<section>${"text"} and some more text</section><footer></footer>" | ||
*[Future] { | ||
( | ||
for snapshot <- !Await(children.snapshots.toLazyList) | ||
yield { | ||
for node <- snapshot.toList | ||
yield node.asInstanceOf[Element].outerHTML | ||
}.mkString | ||
) should be( | ||
LazyList( | ||
"", | ||
"<section>argument and some more text</section>", | ||
"<section>argument and some more text</section><footer></footer>" | ||
) | ||
) | ||
} | ||
} | ||
|
||
} |
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