Skip to content

Commit

Permalink
Merge branch 'trunk' into upgrade/react-native-0.71.8
Browse files Browse the repository at this point in the history
# Conflicts:
#	gutenberg
  • Loading branch information
fluiddot committed Jul 19, 2023
2 parents 4c49d6c + 412eab1 commit c6fb2a5
Show file tree
Hide file tree
Showing 43 changed files with 117 additions and 7 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Unreleased
* [**] 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]
* [**] Upgrade React Native to 0.71.11 [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5874]
* [**] 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.
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 c6fb2a5

Please sign in to comment.