`, so walk
+ // up to the `
` ancestor to safely reach the sibling
+ // `` rather than relying on `.nextElementSibling`.
+ const table = orderedHeader.closest("table")!;
+ const bodyRow = table.querySelector("tbody > tr")!;
+ const bodyCells = Array.from(bodyRow.querySelectorAll("td"));
+ const orderedCell = bodyCells[orderedColIdx];
+ const receivedCell = bodyCells[receivedColIdx];
+
+ // formatCurrency uses Intl with en-ZA / ZAR — substring on the
+ // numeric part to stay ICU-version-tolerant. Assert each value
+ // is in its own column and not the other's.
+ expect(orderedCell).toHaveTextContent("521");
+ expect(orderedCell).not.toHaveTextContent("75");
+ expect(receivedCell).toHaveTextContent("75");
+ expect(receivedCell).not.toHaveTextContent("521");
});
});