Skip to content

Commit 79ac7e9

Browse files
committed
Fix: Hack for MathML because JSDOM does not support it
jsdom/jsdom#3515
1 parent 3c9d2be commit 79ac7e9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/scala/com/raquo/domtestutils/matching/TestableMathMlAttr.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ class TestableMathMlAttr[V](
2020
private[domtestutils] def nodeAttrIs(maybeExpectedValue: Option[V])(node: dom.Node): MaybeError = {
2121
node match {
2222

23-
case (element: dom.MathMLElement) =>
24-
val maybeActualValue = getAttr(element)
23+
// #TODO JSDOM does not implement MathML so...
24+
// - https://github.com/jsdom/jsdom/issues/3515
25+
// - Given that, testing it is kinda useless, but at least we can test the Laminar parts / types...
26+
//
27+
// case element: dom.MathMLElement => // dom.MathMLElement class does not exist in JSDOM
28+
case element if element.namespaceURI == "http://www.w3.org/1998/Math/MathML" =>
29+
val maybeActualValue = getAttr(element.asInstanceOf[dom.MathMLElement])
2530
(maybeActualValue, maybeExpectedValue) match {
2631

2732
case (Some(actualValue), Some(expectedValue)) =>

0 commit comments

Comments
 (0)