-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block bindings: Expose sources in the editor settings to consume them in the client #7020
Changes from 6 commits
c069da7
876155f
745509a
ac767be
2b2bed5
a18de61
f258a46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -269,6 +269,9 @@ public function test_get_all_registered() { | |||
); | ||||
|
||||
$registered = $this->registry->get_all_registered(); | ||||
$this->registry->unregister( 'test/source-one' ); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is more nuanced, but also redundant. There is a new instance of the registry created for every test using the lifecycle method
So, the instance with registered custom sources doesn't persist between tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense as well 🙂 I made this change as part of this commit. |
||||
$this->registry->unregister( 'test/source-two' ); | ||||
$this->registry->unregister( 'test/source-three' ); | ||||
$this->assertEquals( $expected, $registered ); | ||||
} | ||||
|
||||
|
@@ -311,6 +314,9 @@ public function test_get_registered() { | |||
|
||||
$expected = new WP_Block_Bindings_Source( $source_two_name, $source_two_properties ); | ||||
$result = $this->registry->get_registered( 'test/source-two' ); | ||||
$this->registry->unregister( 'test/source-one' ); | ||||
$this->registry->unregister( 'test/source-two' ); | ||||
$this->registry->unregister( 'test/source-three' ); | ||||
|
||||
$this->assertEquals( | ||||
$expected, | ||||
|
@@ -380,6 +386,8 @@ public function test_merging_uses_context_from_multiple_sources() { | |||
); | ||||
|
||||
$new_uses_context = $block_registry->get_registered( 'core/paragraph' )->uses_context; | ||||
unregister_block_bindings_source( 'test/source-one' ); | ||||
SantosGuillamot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
unregister_block_bindings_source( 'test/source-two' ); | ||||
// Checks that the resulting `uses_context` contains the values from both sources. | ||||
$this->assertContains( 'commonContext', $new_uses_context ); | ||||
$this->assertContains( 'sourceOneContext', $new_uses_context ); | ||||
|
Unchanged files with check annotations Beta
await expect( | ||
page, | ||
'should redirect to the installation page' | ||
).toHaveURL( /wp-admin\/install\.php$/ ); | ||
Check failure on line 40 in tests/e2e/specs/install.test.js
|
||
await expect( | ||
page.getByText( /WordPress database error/ ), |
await applicationPasswords.create(); | ||
const [ app ] = await applicationPasswords.get(); | ||
expect( app['name']).toBe( TEST_APPLICATION_NAME ); | ||
Check failure on line 26 in tests/e2e/specs/profile/applications-passwords.test.js
|
||
const successMessage = page.getByRole( 'alert' ); | ||
} | ||
async create(applicationName = TEST_APPLICATION_NAME) { | ||
await this.admin.visitAdminPage( '/profile.php' ); | ||
Check failure on line 110 in tests/e2e/specs/profile/applications-passwords.test.js
|
||
const newPasswordField = this.page.getByRole( 'textbox', { name: 'New Application Password Name' } ); | ||
await expect( newPasswordField ).toBeVisible(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are redundant as there is automated cleanup included in the
tear_down
lifecycle method:wordpress-develop/tests/phpunit/tests/block-bindings/register.php
Lines 38 to 43 in a18de61
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense 🙂 And it explains why they weren't failing before. I made this change as part of this commit.