From d0098e6edb5085ff4c2c489232c01ea258324a7c Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 22 May 2023 11:24:45 -0400 Subject: [PATCH] test: Increase editor history link test accuracy The targeted bug occurs when: 1. Changing a link to "Open in a new tab." 2. Performing additional changes, e.g. typing. 3. Undoing both actions. 4. Redoing both actions. Thus, this changes the initial HTML, adds additional undo/redo invocations, and updates inline snapshots to match the expected outcomes. --- test/native/integration/editor-history.native.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/native/integration/editor-history.native.js b/test/native/integration/editor-history.native.js index 0c336f92be47bd..35ab4d54a0a08e 100644 --- a/test/native/integration/editor-history.native.js +++ b/test/native/integration/editor-history.native.js @@ -179,7 +179,7 @@ describe( 'Editor History', () => { it( 'should preserve editor history when a link has been added and configured to open in a new tab', async () => { // Arrange const initialHtml = ` -

A quick brown fox jumps over the lazy dog.

+

A quick brown fox jumps over the lazy dog.

`; const screen = await initializeEditor( { initialHtml, @@ -201,7 +201,7 @@ describe( 'Editor History', () => { typeInRichText( paragraphTextInput, - 'A quick brown fox jumps over the lazy dog.' + ' A quick brown fox jumps over the lazy dog.' ); // Assert @@ -213,21 +213,23 @@ describe( 'Editor History', () => { // Act fireEvent.press( screen.getByLabelText( 'Undo' ) ); + fireEvent.press( screen.getByLabelText( 'Undo' ) ); // Assert expect( getEditorHtml() ).toMatchInlineSnapshot( ` " -

+

A quick brown fox jumps over the lazy dog.

" ` ); // Act fireEvent.press( screen.getByLabelText( 'Redo' ) ); + fireEvent.press( screen.getByLabelText( 'Redo' ) ); // Assert expect( getEditorHtml() ).toMatchInlineSnapshot( ` " -

A quick brown fox jumps over the lazy dog.

+

A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.

" ` ); } );