[wp-trac] [WordPress Trac] #61371: Improve `class WP_Theme_JSON` tests
WordPress Trac
noreply at wordpress.org
Wed Jun 5 00:54:03 UTC 2024
#61371: Improve `class WP_Theme_JSON` tests
---------------------------+-----------------------------
Reporter: isabel_brison | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: trunk
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
Currently, any change made to styles generated by class `WP_Theme_JSON`
cause multiple tests from its test suite to fail, mostly due to diffs in
CSS strings being checked for equality.
These tests haven't proven very useful to detect bugs in the class, but
they have been incredibly painful to maintain due to the constant updates
of test strings needed every time a change is made to the output styles.
There's more context in
https://github.com/WordPress/gutenberg/issues/60842.
It would be good to at the very least test the output of the functions
called by `get_stylesheet` separately. Ideally we'd minimise comparing
full CSS strings, because they change quite often.
Further ideas for improvement welcome! I'm thinking to work on this core-
first in hopes the changes can still make it into 6.6 and be of benefit
during this cycle.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61371>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list