You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "ktmud (via GitHub)" <gi...@apache.org> on 2023/04/16 02:37:41 UTC

[GitHub] [superset] ktmud commented on a diff in pull request #23695: fix(sqllab): rendering performance regression

ktmud commented on code in PR #23695:
URL: https://github.com/apache/superset/pull/23695#discussion_r1167681903


##########
superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.jsx:
##########
@@ -136,6 +151,21 @@ describe('SqlEditor', () => {
     expect(await findByTestId('react-ace')).toBeInTheDocument();
   });
 
+  it('avoids rerendering EditorLeftBar while typing', async () => {
+    const sqlLabStore = setupStore({
+      initialState: mockInitialState,
+      rootReducers: reducers,
+    });
+    const { findByTestId } = setup(mockedProps, sqlLabStore);
+    const editor = await findByTestId('react-ace');
+    const sql = 'select *';
+    const renderCount = SqlEditorLeftBar.mock.calls.length;
+    expect(SqlEditorLeftBar).toHaveBeenCalledTimes(renderCount);
+    fireEvent.change(editor, { target: { value: sql } });
+    // Verify the rendering regression
+    expect(SqlEditorLeftBar).toHaveBeenCalledTimes(renderCount);

Review Comment:
   nice tests



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org