Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Bug: themed() test util incorrectly handles RegExp arguments #10389

Closed
maxpatiiuk opened this issue Sep 25, 2024 · 2 comments
Closed
Assignees
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.

Comments

@maxpatiiuk
Copy link
Member

maxpatiiuk commented Sep 25, 2024

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:

if (value instanceof RegExp && attr && value.test(attr)) {

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:

  • remove the code for matching attribute values against RegExp since it's not used
  • manually serialize and deserialize the RegExp values

Test error, if applicable

No response

PR skipped, if applicable

No response

Additional Info

No response

@maxpatiiuk maxpatiiuk added testing Issues related to automated or manual testing. 0 - new New issues that need assignment. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. labels Sep 25, 2024
@github-actions github-actions bot added the p - low Issue is non core or affecting less that 10% of people using the library label Sep 25, 2024
@maxpatiiuk maxpatiiuk changed the title [Tests] Bug: themed() test util incorrectly handle RegExp argument [Tests] Bug: themed() test util incorrectly handles RegExp arguments Sep 25, 2024
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Sep 27, 2024
@jcfranco jcfranco self-assigned this Sep 27, 2024
@jcfranco jcfranco added estimate - 2 Small fix or update, may require updates to tests. and removed needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. labels Sep 27, 2024
@jcfranco jcfranco added this to the 2024-10-29 - Oct Milestone milestone Sep 27, 2024
jcfranco added a commit that referenced this issue Sep 27, 2024
**Related Issue:** #10389

## Summary

We can restore this later if needed.
@jcfranco jcfranco added the 3 - installed Issues that have been merged to master branch and are ready for final confirmation. label Sep 27, 2024
@github-actions github-actions bot removed the 2 - in development Issues that are actively being worked on. label Sep 27, 2024
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned jcfranco Sep 27, 2024
Copy link
Contributor

Installed and assigned for verification.

@DitwanP
Copy link
Contributor

DitwanP commented Oct 2, 2024

🧹✨

@DitwanP DitwanP closed this as completed Oct 2, 2024
@DitwanP DitwanP added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

4 participants