Skip to content

Commit

Permalink
test: Remove unused removeBlockAtPosition utility
Browse files Browse the repository at this point in the history
All usage was removed in
#52289. Additionally, the
utility may be outdated and incompatible with the current editor UI.
  • Loading branch information
dcalhoun committed Jan 23, 2024
1 parent 8618276 commit ad3646c
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions packages/react-native-editor/__device-tests__/pages/editor-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,46 +670,6 @@ class EditorPage {
await moveDownButton.click();
}

// Position of the block to remove
// Block will no longer be present if this succeeds.
async removeBlockAtPosition( blockName = '', position = 1 ) {
if ( ! ( await this.hasBlockAtPosition( position, blockName ) ) ) {
throw Error( `No Block at position ${ position }` );
}

const buttonElementName = isAndroid()
? '//*'
: '//XCUIElementTypeButton';
const blockActionsMenuButtonIdentifier = `Open Block Actions Menu`;
const blockActionsMenuButtonLocator = `${ buttonElementName }[contains(@${ this.accessibilityIdXPathAttrib }, "${ blockActionsMenuButtonIdentifier }")]`;
if ( isAndroid() ) {
const block = await this.getBlockAtPosition( blockName, position );
let checkList = await this.driver.$$(
blockActionsMenuButtonLocator
);
while ( checkList.length === 0 ) {
await swipeUp( this.driver, block ); // Swipe up to show remove icon at the bottom.
checkList = await this.driver.$$(
blockActionsMenuButtonLocator
);
}
}

const blockActionsMenuButton = await waitForVisible(
this.driver,
blockActionsMenuButtonLocator
);
await blockActionsMenuButton.click();
const removeActionButtonIdentifier = 'Remove block';
const removeActionButtonLocator = `${ buttonElementName }[contains(@${ this.accessibilityIdXPathAttrib }, "${ removeActionButtonIdentifier }")]`;
const removeActionButton = await waitForVisible(
this.driver,
removeActionButtonLocator
);

await removeActionButton.click();
}

// =========================
// Formatting toolbar functions
// =========================
Expand Down

0 comments on commit ad3646c

Please sign in to comment.