Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update refresh for dashboard scene #346

Merged
merged 11 commits into from
Oct 25, 2024
Merged

Conversation

vitPinchuk
Copy link
Contributor

No description provided.

@vitPinchuk vitPinchuk self-assigned this Oct 22, 2024
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.67%. Comparing base (9f6b696) to head (8c37a63).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #346      +/-   ##
==========================================
+ Coverage   98.55%   98.67%   +0.12%     
==========================================
  Files          58       58              
  Lines         830      832       +2     
  Branches      150      138      -12     
==========================================
+ Hits          818      821       +3     
+ Misses         12       11       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vitPinchuk vitPinchuk marked this pull request as ready for review October 22, 2024 07:40
@vitPinchuk vitPinchuk marked this pull request as draft October 22, 2024 09:42
@mikhail-vl mikhail-vl added the enhancement New feature or request label Oct 22, 2024
@mikhail-vl mikhail-vl added this to the Charts 6.5.0 milestone Oct 22, 2024
@vitPinchuk vitPinchuk marked this pull request as ready for review October 22, 2024 11:20
Copy link
Collaborator

@asimonok asimonok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In tests we should check if useDashboardRefresh is called instead of checking implementation of the hook. Please update tests

@mikhail-vl
Copy link
Member

@vitPinchuk Please fix tests after upgrading to Grafana 11.3.0:

    console.error
      Warning: Cannot update a component (`Unknown`) while rendering a different component (`mockConstructor`). To locate the bad setState() call inside `mockConstructor`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
          at mockConstructor
          at value (/Users/mikhailvolkov/GitHub/business-charts/node_modules/@volkovlabs/components/src/components/AutosizeCodeEditor/AutosizeCodeEditor.tsx:48:3)
          at div
          at value (/Users/mikhailvolkov/GitHub/business-charts/src/components/EchartsEditor/EchartsEditor.tsx:26:50)

       98 |
       99 |     jest.mocked(CodeEditor).mockImplementationOnce(({ onEditorDidMount }: any) => {
    > 100 |       onEditorDidMount(editor);
          |       ^
      101 |       return null;
      102 |     });
      103 |
Console

    console.error
      Warning: An update to EchartsPanel inside a test was not wrapped in act(...).
      
      When testing, code that causes React state updates should be wrapped into act(...):
      
      act(() => {
        /* fire events that update state */
      });
      /* assert on the output */
      
      This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
          at options (/Users/mikhailvolkov/GitHub/business-charts/src/components/EchartsPanel/EchartsPanel.tsx:31:49)

      293 |         );
      294 |       } catch (err) {
    > 295 |         setError(err instanceof Error ? err : new Error(`${err}`));
          |         ^
      296 |       }
      297 |     };
      298 |

Copy link
Collaborator

@asimonok asimonok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix act warnings

@vitPinchuk
Copy link
Contributor Author

ter upgrading to Grafana 11.3.0:

done

Copy link
Member

@mikhail-vl mikhail-vl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mikhail-vl mikhail-vl self-requested a review October 25, 2024 09:52
@mikhail-vl
Copy link
Member

@asimonok Could you please check and approve?

Copy link
Collaborator

@asimonok asimonok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mikhail-vl mikhail-vl merged commit eea576c into main Oct 25, 2024
8 checks passed
@mikhail-vl mikhail-vl deleted the refresh-ivent-scene-dashboard branch October 25, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants