From 2b80181a7208f6c13909ddd90ee371ab53f33e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kozak?= Date: Wed, 4 Oct 2023 08:52:35 +0200 Subject: [PATCH] refactor test --- .../wrappers/jquery_test/TraversingTest.scala | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala b/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala index 007e03e..cf6b100 100644 --- a/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala +++ b/src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala @@ -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._ @@ -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" } + } }