-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4291 from wordpress-mobile/add/tiled-gallery-block
Initial Port of Jetpack Tiled Gallery Block
- Loading branch information
Showing
22 changed files
with
948 additions
and
758 deletions.
There are no files selected for viewing
Binary file added
BIN
+4.14 KB
...ojects_plugins_jetpack_extensions_blocks_tiledgallery_tiledgallery_example1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.98 KB
...ojects_plugins_jetpack_extensions_blocks_tiledgallery_tiledgallery_example2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.7 KB
...ojects_plugins_jetpack_extensions_blocks_tiledgallery_tiledgallery_example3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.8 KB
...ojects_plugins_jetpack_extensions_blocks_tiledgallery_tiledgallery_example4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.92 KB
...ojects_plugins_jetpack_extensions_blocks_tiledgallery_tiledgallery_example5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.11 KB
...ojects_plugins_jetpack_extensions_blocks_tiledgallery_tiledgallery_example6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file added
BIN
+4.14 KB
...cts/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery_example-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.98 KB
...cts/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery_example-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.7 KB
...cts/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery_example-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.8 KB
...cts/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery_example-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.92 KB
...cts/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery_example-5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.11 KB
...cts/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery_example-6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Submodule gutenberg
updated
20 files
Submodule jetpack
updated
2599 files
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
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,84 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { | ||
getEditorHtml, | ||
initializeEditor, | ||
fireEvent, | ||
waitFor, | ||
within, | ||
} from 'test/helpers'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks'; | ||
import { registerCoreBlocks } from '@wordpress/block-library'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { | ||
registerJetpackBlocks, | ||
setupJetpackEditor, | ||
} from '../../jetpack-editor-setup'; | ||
|
||
const defaultProps = { | ||
capabilities: { | ||
tiledGalleryBlock: true, | ||
}, | ||
}; | ||
|
||
beforeAll( () => { | ||
// Register all core blocks | ||
registerCoreBlocks(); | ||
// Register Jetpack blocks | ||
setupJetpackEditor( { blogId: 1, isJetpackActive: true } ); | ||
registerJetpackBlocks( defaultProps ); | ||
} ); | ||
|
||
afterAll( () => { | ||
// Clean up registered blocks | ||
getBlockTypes().forEach( ( block ) => { | ||
unregisterBlockType( block.name ); | ||
} ); | ||
} ); | ||
|
||
describe.skip( 'Tiled Gallery block', () => { | ||
it( 'inserts the block', async () => { | ||
const { | ||
getByA11yLabel, | ||
getByTestId, | ||
getByText, | ||
debug, | ||
} = await initializeEditor( { | ||
initialHtml: '', | ||
capabilities: { tiledGalleryBlock: true }, | ||
} ); | ||
|
||
// Open the inserter menu | ||
fireEvent.press( await waitFor( () => getByA11yLabel( 'Add block' ) ) ); | ||
|
||
const blockList = getByTestId( 'InserterUI-Blocks' ); | ||
// onScroll event used to force the FlatList to render all items | ||
fireEvent.scroll( blockList, { | ||
nativeEvent: { | ||
contentOffset: { y: 0, x: 0 }, | ||
contentSize: { width: 100, height: 100 }, | ||
layoutMeasurement: { width: 100, height: 100 }, | ||
}, | ||
} ); | ||
|
||
// Insert the block | ||
fireEvent.press( await waitFor( () => getByText( 'Tiled Gallery' ) ) ); | ||
|
||
// Get the block | ||
const block = await waitFor( () => | ||
getByA11yLabel( /Tiled Gallery Block\. Row 1/ ) | ||
); | ||
|
||
expect( block ).toBeDefined(); | ||
const expectedHtml = `<!-- wp:jetpack/tiled-gallery /-->`; | ||
expect( getEditorHtml() ).toBe( expectedHtml ); | ||
} ); | ||
} ); |
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