[Tests] Bug: themed() test util incorrectly handles RegExp arguments #10389
Labels
4 - verified
Issues that have been released and confirmed resolved.
estimate - 2
Small fix or update, may require updates to tests.
p - low
Issue is non core or affecting less that 10% of people using the library
testing
Issues related to automated or manual testing.
Milestone
Priority impact
p - low
Test type
bug
Which Component(s)
themed() test util
Unstable Tests
The themed() test util Calcite has allows asserting the computed style of an element with a given attribute. For attribute value matching, it accepts string or RegExp values.
However, since the attribute values are evaluated in the browser, the values need to be serialized and deserialized.
Puppeteer converts RegExp to empty objects (
{}
). Thus, the following condition will never match:calcite-design-system/packages/calcite-components/src/tests/commonTests/themed.ts
Line 313 in 2d19268
Because of this, matching attribute values by RegExp in
themed()
does not work.The bug does not impact existing tests since no place at the moment is passing a RegExp to
themed()
as far as I can see.Options:
Test error, if applicable
No response
PR skipped, if applicable
No response
Additional Info
No response
The text was updated successfully, but these errors were encountered: