Skip to content

Commit

Permalink
Merge pull request #5969 from wordpress-mobile/update-media-placehold…
Browse files Browse the repository at this point in the history
…ers-and-block-outline

Update media placeholders and block outline
  • Loading branch information
Gerardo Pacheco authored Jul 19, 2023
2 parents 6f1d7e7 + 7b2ae77 commit 412eab1
Show file tree
Hide file tree
Showing 44 changed files with 118 additions and 8 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Unreleased
* [**] Move the undo/redo buttons to the navigation bar [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5889]
* [**] Update Editor block inserter button styles and default text input placeholder/selection styles [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5941]
* [**] Update Editor toolbar icons and colors [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5940]
* [**] Update media placeholders and block outline [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5969]

1.99.1
---
Expand Down
109 changes: 109 additions & 0 deletions __device-tests__/gutenberg-editor-unsupported-block-visual.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
* Internal dependencies
*/
const { isAndroid, toggleDarkMode, isEditorVisible } = e2eUtils;
import { takeScreenshot } from './utils';

describe( 'Gutenberg Editor Visual test for Unsupported Block', () => {
it( 'should show the empty placeholder for the selected/unselected state', async () => {
await editorPage.setHtmlContent( e2eTestData.unsupportedBlockHtml );

let unsupportedBlock = await editorPage.getBlockAtPosition(
editorPage.blockNames.unsupported
);
await unsupportedBlock.click();

// Visual test check
let screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot();

// Select title to unfocus the block
const titleElement = await editorPage.getTitleElement();
await titleElement.click();

await editorPage.dismissKeyboard();

// Visual test check
screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot();

unsupportedBlock = await editorPage.getBlockAtPosition(
editorPage.blockNames.unsupported
);
await unsupportedBlock.click();
await editorPage.removeBlock();
} );

it( 'should show the empty placeholder for the selected/unselected state in dark mode', async () => {
await toggleDarkMode( editorPage.driver, true );

// The Android editor requires a restart to apply dark mode
if ( isAndroid() ) {
await editorPage.driver.resetApp();
await isEditorVisible( editorPage.driver );
}

await editorPage.setHtmlContent( e2eTestData.unsupportedBlockHtml );

let unsupportedBlock = await editorPage.getBlockAtPosition(
editorPage.blockNames.unsupported
);
await unsupportedBlock.click();

// Visual test check
let screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot();

// Select title to unfocus the block
const titleElement = await editorPage.getTitleElement();
await titleElement.click();

await editorPage.dismissKeyboard();

// Visual test check
screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot();

unsupportedBlock = await editorPage.getBlockAtPosition(
editorPage.blockNames.unsupported
);
await unsupportedBlock.click();
await editorPage.removeBlock();

await toggleDarkMode( editorPage.driver, false );

// The Android editor requires a restart to apply dark mode
if ( isAndroid() ) {
await editorPage.driver.resetApp();
await isEditorVisible( editorPage.driver );
}
} );

it( 'should be able to open the unsupported block web view editor', async () => {
await editorPage.setHtmlContent( e2eTestData.unsupportedBlockHtml );

const unsupportedBlock = await editorPage.getBlockAtPosition(
editorPage.blockNames.unsupported
);
await unsupportedBlock.click();

const helpButton = await editorPage.getUnsupportedBlockHelpButton();
await helpButton.click();

// Wait for the modal to show
await editorPage.driver.sleep( 3000 );

// Visual test check
const screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot();

// Disabled for now on Android see https://github.com/wordpress-mobile/gutenberg-mobile/issues/5321
if ( ! isAndroid() ) {
const editButton = await editorPage.getUnsupportedBlockBottomSheetEditButton();
await editButton.click();

const webView = await editorPage.getUnsupportedBlockWebView();
await expect( webView ).toBeTruthy();
}
} );
} );
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 124 files
14 changes: 7 additions & 7 deletions src/test/videopress/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe( 'VideoPress block - Uploads', () => {
initialHtml,
} );

fireEvent.press( getByText( 'ADD VIDEO' ) );
fireEvent.press( getByText( 'Add video' ) );

// Observe that media options picker is displayed
if ( Platform.isIOS ) {
Expand Down Expand Up @@ -143,7 +143,7 @@ describe( 'VideoPress block - Uploads', () => {
expect( block ).toBeVisible();

// Upload video from device
fireEvent.press( getByText( 'ADD VIDEO' ) );
fireEvent.press( getByText( 'Add video' ) );
selectOption( 'Choose from device' );
expectMediaPickerCall( 'DEVICE_MEDIA_LIBRARY', [ 'video' ], false );

Expand Down Expand Up @@ -229,7 +229,7 @@ describe( 'VideoPress block - Uploads', () => {
expect( block ).toBeVisible();

// Add video from WordPress media library
fireEvent.press( getByText( 'ADD VIDEO' ) );
fireEvent.press( getByText( 'Add video' ) );
selectOption( 'WordPress Media Library' );
expectMediaPickerCall( 'SITE_MEDIA_LIBRARY', [ 'video' ], false );

Expand Down Expand Up @@ -296,7 +296,7 @@ describe( 'VideoPress block - Uploads', () => {
expect( block ).toBeVisible();

// Take a video and upload it
fireEvent.press( getByText( 'ADD VIDEO' ) );
fireEvent.press( getByText( 'Add video' ) );
selectOption( 'Take a Video' );
expectMediaPickerCall( 'DEVICE_CAMERA', [ 'video' ], false );

Expand Down Expand Up @@ -374,7 +374,7 @@ describe( 'VideoPress block - Uploads', () => {
expect( block ).toBeVisible();

// Insert video from URL
fireEvent.press( getByText( 'ADD VIDEO' ) );
fireEvent.press( getByText( 'Add video' ) );
selectOption( 'Insert from URL' );
expect( prompt ).toHaveBeenCalled();

Expand Down Expand Up @@ -514,7 +514,7 @@ describe( 'VideoPress block - Uploads', () => {
expect( block ).toBeVisible();

// Upload video from device
fireEvent.press( getByText( 'ADD VIDEO' ) );
fireEvent.press( getByText( 'Add video' ) );
selectOption( 'Choose from device' );
expectMediaPickerCall( 'DEVICE_MEDIA_LIBRARY', [ 'video' ], false );

Expand Down Expand Up @@ -564,7 +564,7 @@ describe( 'VideoPress block - Uploads', () => {
expect( block ).toBeVisible();

// Upload video from device
fireEvent.press( getByText( 'ADD VIDEO' ) );
fireEvent.press( getByText( 'Add video' ) );
selectOption( 'Choose from device' );
expectMediaPickerCall( 'DEVICE_MEDIA_LIBRARY', [ 'video' ], false );

Expand Down

0 comments on commit 412eab1

Please sign in to comment.