Make WordPress Core

Opened 21 months ago

Closed 16 months ago

Last modified 16 months ago

#56797 closed defect (bug) (fixed)

Add unit tests for block registration with RTL stylesheets

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-unit-tests dev-feedback has-patch
Focuses: css, rtl Cc:

Description (last modified by SergeyBiryukov)

Background: #56325

[54330] should have some unit tests for register_block_style_handle() to confirm that RTL stylesheets for blocks are correctly loaded when an RTL locale is set.

Attachments (1)

56797.patch (1.4 KB) - added by thomasplevy 17 months ago.

Download all attachments as: .zip

Change History (15)

#1 @SergeyBiryukov
21 months ago

  • Description modified (diff)

#2 @SergeyBiryukov
21 months ago

  • Summary changed from Add unit tests for block registration tests with RTL stylesheets to Add unit tests for block registration with RTL stylesheets

@thomasplevy
17 months ago

#3 @thomasplevy
17 months ago

@SergeyBiryukov how's the above patch to cover the RTL-related code?

This ticket was mentioned in Slack in #core by costdev. View the logs.


16 months ago

#5 @johnbillion
16 months ago

  • Keywords has-unit-tests dev-feedback added; needs-unit-tests removed

This ticket was mentioned in Slack in #core by costdev. View the logs.


16 months ago

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


16 months ago

This ticket was mentioned in PR #4150 on WordPress/wordpress-develop by @costdev.


16 months ago
#8

  • Keywords has-patch added

This adds a PHPUnit test for register_block_style_handle() to confirm that RTL stylesheets for blocks are correctly loaded when an RTL locale is set.

Refreshes the previous patch.

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

#9 @costdev
16 months ago

@SergeyBiryukov I've submitted PR 4150 which refreshes 56797.patch to improve the docblock, to reset the text direction before the assertions, and to add $message parameters to the assertions.

I ran a coverage report, and can confirm that the test covers the related lines - Screenshot.

This ticket was mentioned in Slack in #core by costdev. View the logs.


16 months ago

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


16 months ago

#12 @costdev
16 months ago

This ticket was discussed during the bug scrub. @SergeyBiryukov, do you have time to take a look at PR 4150 before RC1 on Thursday 9th March?

Additional props: @mukesh27

#13 @SergeyBiryukov
16 months ago

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

In 55486:

Tests: Add a unit test for register_block_style_handle() with an RTL locale.

The test ensures that the function loads RTL stylesheets when a locale with the right-to-left text direction is set.

Follow-up to [54330].

Props costdev, thomasplevy, audrasjb, mukesh27.
Fixes #56797.

@SergeyBiryukov commented on PR #4150:


16 months ago
#14

Thanks for the PR! Merged in r55486.

Note: See TracTickets for help on using tickets.