Skip to content

Commit

Permalink
refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
halotukozak committed Oct 4, 2023
1 parent cf69232 commit 2b80181
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import org.scalajs.dom.HTMLSpanElement
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

import scala.scalajs.js
import scala.scalajs.js.Object.entries

class TraversingTest extends AnyWordSpec with Matchers {

import io.udash.wrappers.jquery._
Expand Down Expand Up @@ -182,17 +179,9 @@ class TraversingTest extends AnyWordSpec with Matchers {
).render

val root = jQ(dom)
val evens = root.children("span").even()
val odds = root.children("span").odd()

entries(evens).collect {
case js.Tuple2(_: String, x: HTMLSpanElement) => x.textContent
}.toSeq shouldBe Seq("0", "2", "4")

entries(odds).collect {
case js.Tuple2(_: String, x: HTMLSpanElement) => x.textContent
}.toSeq shouldBe Seq("1", "3", "5")

root.children("span").even().text() shouldBe "024"
root.children("span").odd().text() shouldBe "135"
}

}
}

0 comments on commit 2b80181

Please sign in to comment.