-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Generic end 2 end test to the block transforms. (#12336)
## Description This is a second try on PR #10536, after a recommendation by @gziolo to try to make the PR smaller so it becomes easier to review. In order to make the PR smaller, I temporarily created a list of test fixtures that intersects with the set of all fixtures so most fixtures are ignored. Another PR will follow that corrects the fixtures (mainly media ones) so they are reliable and can be used in this tests (e.g: don't trigger 404 requests). All the mechanisms are present in this PR the only change that will happen in the other PR is the removal of the intersection and its list, the update of some media fixtures and the creation of new snapshots. This is a high-level test that is going to Guarantee that every possible transform on Gutenberg is tested and works as expected (the result matches the save snapshot). ## How has this been tested? Verify all test cases pass.
- Loading branch information
1 parent
3f28c95
commit f4de109
Showing
6 changed files
with
612 additions
and
34 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,13 @@ | ||
/** | ||
* Returns a string containing the block title associated with the provided block name. | ||
* @param {string} blockName Block name. | ||
* @param {string} setting Block setting e.g: title, attributes.... | ||
* | ||
* @return {Promise} Promise resolving with a string containing the block title. | ||
*/ | ||
export async function getBlockSetting( blockName, setting ) { | ||
return page.evaluate( ( _blockName, _setting ) => { | ||
const blockType = wp.data.select( 'core/blocks' ).getBlockType( _blockName ); | ||
return blockType && blockType[ _setting ]; | ||
}, blockName, setting ); | ||
} |
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
Oops, something went wrong.