Skip to content

Commit

Permalink
[RNMobile] Invert the expect matcher values of the e2e tests (#28770)
Browse files Browse the repository at this point in the history
* Inverted the expect matcher values of the e2e tests

* Fixed spacing of html
  • Loading branch information
jd-alexander authored Feb 7, 2021
1 parent 702c76e commit c53d26e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ describe( 'Gutenberg Editor tests for Block insertion', () => {

const html = await editorPage.getHtmlContent();

expect( testData.blockInsertionHtml.toLowerCase() ).toBe(
html.toLowerCase()
expect( html.toLowerCase() ).toBe(
testData.blockInsertionHtml.toLowerCase()
);

// wait for the block editor to load and for accessibility ids to update
Expand Down Expand Up @@ -118,8 +118,8 @@ describe( 'Gutenberg Editor tests for Block insertion', () => {
await paragraphBlockElement.click();
const html = await editorPage.getHtmlContent();

expect( testData.blockInsertionHtmlFromTitle.toLowerCase() ).toBe(
html.toLowerCase()
expect( html.toLowerCase() ).toBe(
testData.blockInsertionHtmlFromTitle.toLowerCase()
);
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ describe( 'Gutenberg Editor Image Block tests', () => {
if ( ! isAndroid() ) {
const html = await editorPage.getHtmlContent();

expect( testData.imageShorteHtml.toLowerCase() ).toBe(
html.toLowerCase()
expect( html.toLowerCase() ).toBe(
testData.imageShorteHtml.toLowerCase()
);
}
/* eslint-enable jest/no-conditional-expect */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe( 'Gutenberg Editor tests for List block', () => {

// switch to html and verify html
const html = await editorPage.getHtmlContent();
expect( testData.listHtml.toLowerCase() ).toBe( html.toLowerCase() );
expect( html.toLowerCase() ).toBe( testData.listHtml.toLowerCase() );
} );

// This test depends on being run immediately after 'should be able to add a new List block'
Expand All @@ -50,8 +50,8 @@ describe( 'Gutenberg Editor tests for List block', () => {

// switch to html and verify html
const html = await editorPage.getHtmlContent();
expect( testData.listHtmlOrdered.toLowerCase() ).toBe(
html.toLowerCase()
expect( html.toLowerCase() ).toBe(
testData.listHtmlOrdered.toLowerCase()
);
// Remove list block to return editor to empty state
listBlockElement = await editorPage.getBlockAtPosition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ describe( 'Gutenberg Editor tests for List block (end)', () => {
await editorPage.sendTextToListBlock( listBlockElement, '\n' );

const html = await editorPage.getHtmlContent();
expect( testData.listEndedHtml.toLowerCase() ).toBe(
html.toLowerCase()

expect( html.toLowerCase() ).toBe(
testData.listEndedHtml.toLowerCase()
);
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ describe( 'Gutenberg Editor tests for List block', () => {

// switch to html and verify html
const html = await editorPage.getHtmlContent();
expect(

expect( html.toLowerCase() ).toBe(
`<!-- wp:list -->
<ul><li> a</li></ul>
<!-- /wp:list -->`
).toBe( html.toLowerCase() );
);

// Remove list block to reset editor to clean state
listBlockElement = await editorPage.getBlockAtPosition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ describe( 'Gutenberg Editor paste tests', () => {

// check styled text by verifying html contents
const html = await editorPage.getHtmlContent();
expect( testData.pasteHtmlTextResult.toLowerCase() ).toBe(
html.toLowerCase()

expect( html.toLowerCase() ).toBe(
testData.pasteHtmlTextResult.toLowerCase()
);
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ describe( 'Gutenberg Editor tests', () => {
await toggleOrientation( editorPage.driver );

const html = await editorPage.getHtmlContent();
expect( testData.deviceRotationHtml.toLowerCase() ).toBe(
html.toLowerCase()

expect( html.toLowerCase() ).toBe(
testData.deviceRotationHtml.toLowerCase()
);
} );
} );

0 comments on commit c53d26e

Please sign in to comment.