Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#56611 closed task (blessed) (fixed)

Expand unit tests for `theme.json`

Reported by: desrosj's profile desrosj Owned by: audrasjb's profile audrasjb
Milestone: 6.1 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

As support new properties in theme.json has been added and expanded, the unit tests have not kept up.

There's a block theme used within unit tests missing some of the supported properties listed in the living reference.

I noticed this when merging support for box-shadow on specific elements in [54253]. Ideally new tests should be added each time properties and values allowed in theme.json change.

Attachments (1)

56611.diff (13.0 KB) - added by johnregan3 2 years ago.
New theme.json Unit Tests

Download all attachments as: .zip

Change History (10)

@johnregan3
2 years ago

New theme.json Unit Tests

#1 @johnregan3
2 years ago

@desrosj Added new unit tests for:

  • Gradients
  • filter (Duotones)
  • blockGap
  • shadow
  • useRootPaddingAwareAlignments
  • appearanceTools

This is based off of the current version of the living reference mentioned above.

Please update the Workflow Keywords as you deem appropriate.

#2 @desrosj
2 years ago

  • Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed

Thanks @johnregan3!

I'm going to create a GitHub pull request just to confirm the tests are passing correctly.

This ticket was mentioned in PR #3399 on WordPress/wordpress-develop by desrosj.


2 years ago
#3

Added new unit tests for:

  • Gradients
  • filter (Duotones)
  • blockGap
  • shadow
  • useRootPaddingAwareAlignments
  • appearanceTools

Trac ticket: https://core.trac.wordpress.org/ticket/56611

#4 @audrasjb
2 years ago

I added a commit to the above PR to fix a WPCS issue.

#5 @mukesh27
2 years ago

PR #3399 Look good now. Approved.

#6 @audrasjb
2 years ago

Self assigning for commit

#7 @audrasjb
2 years ago

  • Owner set to audrasjb
  • Resolution set to fixed
  • Status changed from new to closed

In 54443:

Build/Test Tools: Expand unit tests for theme.json.

This changeset adds unit test coverage for the following features:

  • Gradients
  • filter (Duotones)
  • blockGap
  • shadow
  • useRootPaddingAwareAlignments
  • appearanceTools

Props gunterer, johnregan3, audrasjb, mukesh27.
Fixes #56611.

#9 @audrasjb
2 years ago

In 54444:

Build/Test Tools: Add missing newline character on unit tests files after [54443].

Follow-up to [54443].

See #56611.

Note: See TracTickets for help on using tickets.