Skip to content

Tests: Add unit tests for Button block __experimentalLabel functionality (follows #74163)#74175

Closed
SirLouen wants to merge 1 commit into
WordPress:update/button-block-labelfrom
SirLouen:tests/74163
Closed

Tests: Add unit tests for Button block __experimentalLabel functionality (follows #74163)#74175
SirLouen wants to merge 1 commit into
WordPress:update/button-block-labelfrom
SirLouen:tests/74163

Conversation

@SirLouen

Copy link
Copy Markdown
Member

What?

Adding some Unit Tests for #74163

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Dec 22, 2025
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: SirLouen <sirlouen@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@SirLouen SirLouen requested a review from youknowriad December 22, 2025 18:50
@SirLouen SirLouen self-assigned this Dec 22, 2025
@SirLouen SirLouen added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Dec 22, 2025
@SirLouen SirLouen requested review from jasmussen and removed request for ajitbohra and fabiankaegy December 22, 2025 18:51
@SirLouen SirLouen changed the base branch from trunk to update/button-block-label December 22, 2025 19:12

it( 'returns "Button" when attributes is undefined', () => {
expect( getLabel( undefined ) ).toBe( 'Button' );
} );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like discussed in the other PR, and given all the other blocks don't do defensive coding for undefined and null, I think we should remove these two test cases and ship this PR.

@youknowriad youknowriad force-pushed the update/button-block-label branch from 8281e8e to 146ae80 Compare December 23, 2025 11:18
@youknowriad youknowriad deleted the branch WordPress:update/button-block-label December 23, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants