Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#56797 closed defect (bug) (fixed)

Add unit tests for block registration with RTL stylesheets

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

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 4 years ago.

Download all attachments as: .zip

Change History (15)

#1 @SergeyBiryukov
4 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
4 years ago

  • Summary Add unit tests for block registration tests with RTL stylesheets → Add unit tests for block registration with RTL stylesheets

@thomasplevy
4 years ago

#3 @thomasplevy
4 years 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.


4 years ago

#5 @johnbillion
4 years 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.


4 years ago

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


4 years ago

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


4 years 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
4 years 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.


4 years ago

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


4 years ago

#12 @costdev
4 years 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
4 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → 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:


4 years ago
#14

Thanks for the PR! Merged in r55486.

Note: See TracTickets for help on using tickets.