Skip to content

Commit 3428fc9

Browse files
authored
fix(test): scope m:nary supHide assertion to operator wrapper (#2833)
The union-with-supHide assertion checked for any <msub> in the whole <math> element, but the scenario 6 fixture body contains <m:sSub> (Aᵢ), which legitimately renders as <msub>. That made the test fail on every run since it landed. Assert on the n-ary's own wrapper (the parent of <mo>⋃</mo>) instead, which is what the test was actually trying to verify.
1 parent f175c5d commit 3428fc9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/behavior/tests/importing/math-equations.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,14 +957,18 @@ test.describe('m:nary (n-ary operator) rendering', () => {
957957
const math = document.querySelectorAll('math')[5];
958958
const munder = math?.querySelector('munder');
959959
if (!munder) return null;
960+
// The n-ary body contains m:sSub (Aᵢ), which legitimately renders as <msub>.
961+
// Assert only on the n-ary's own wrapper — the element parenting <mo>⋃</mo>.
962+
const unionOp = Array.from(math.querySelectorAll('mo')).find((m) => m.textContent === '\u22C3');
963+
const naryWrapperTag = unionOp?.parentElement?.tagName.toLowerCase();
960964
return {
961-
hasMsub: math?.querySelector('msub') !== null,
965+
naryWrapperTag,
962966
opChar: munder.children[0]?.textContent,
963967
under: munder.children[1]?.textContent,
964968
};
965969
});
966970
expect(data).not.toBeNull();
967-
expect(data!.hasMsub).toBe(false);
971+
expect(data!.naryWrapperTag).toBe('munder');
968972
expect(data!.opChar).toBe('\u22C3');
969973
expect(data!.under).toBe('i');
970974
});

0 commit comments

Comments
 (0)