-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enforce display condition to return string in
render_block
filter
- Loading branch information
1 parent
cf729b1
commit 8cf9764
Showing
3 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { test, expect } from '@wordpress/e2e-test-utils-playwright'; | ||
import { tryLoginIn } from '../utils'; | ||
|
||
test.describe( 'Block Conditions', () => { | ||
test.beforeEach( async({ admin, requestUtils, page }) => { | ||
await tryLoginIn( page, 'admin', 'password' ); | ||
await admin.createNewPost(); | ||
}); | ||
|
||
test( 'check logged out users', async({ editor, page, admin, requestUtils }) => { | ||
await editor.insertBlock({ | ||
name: 'core/image', | ||
attributes: { | ||
url: 'https://mllj2j8xvfl0.i.optimole.com/cb:jC7e.37109/w:794/h:397/q:mauto/dpr:2.0/f:best/https://themeisle.com/blog/wp-content/uploads/2021/01/How-to-Change-Font-in-WordPress-Theme.png', | ||
otterConditions: [ | ||
[ | ||
{ | ||
type: 'loggedInUser' | ||
} | ||
] | ||
] | ||
} | ||
}); | ||
|
||
const postId = await editor.publishPost(); | ||
|
||
await page.goto( `/?p=${postId}` ); | ||
|
||
await expect( page.locator( '#wp--skip-link--target img' ) ).toBeVisible(); | ||
|
||
await page.getByRole( 'menuitem', { name: 'Howdy, admin' }).hover(); | ||
|
||
await page.waitForTimeout( 200 ); | ||
|
||
await page.getByRole( 'menuitem', { name: 'Log Out' }).click(); | ||
await page.goto( `/?p=${postId}` ); | ||
await expect( page.locator( '#wp--skip-link--target img' ) ).toBeHidden(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters