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

chore: Tolerate other analytics events in flashbar analytics tests #2688

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

just-boris
Copy link
Member

Description

  1. Fixing the tests to make them compatible with this change: feat: Send metrics no panorama API as a fallback component-toolkit#96
  2. Extracted analytics tests in a separate file. Previously, one-time metrics were not captured, because they happened in unrelated unit tests

Related links, issue #, if available: n/a

How has this been tested?

  1. PR build passes
  2. Ran tests locally using the changes from the other PR (feat: Send metrics no panorama API as a fallback component-toolkit#96), they pass too
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -20,22 +19,14 @@ let useVisualRefresh = false;
jest.mock('../../../lib/components/internal/hooks/use-visual-mode', () => {
const originalVisualModeModule = jest.requireActual('../../../lib/components/internal/hooks/use-visual-mode');
return {
__esModule: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing unused hack

@@ -450,155 +441,3 @@ describe('Flashbar component', () => {
testFlashDismissal({ stackItems: false });
});
});

describe('Analytics', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a separate top-level describe block, which naturally suggests it should be a separate test file in the first place

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.85%. Comparing base (7ddef11) to head (df863d9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2688    +/-   ##
========================================
  Coverage   95.85%   95.85%            
========================================
  Files         744      744            
  Lines       20581    20581            
  Branches     6644     7015   +371     
========================================
  Hits        19727    19727            
  Misses        846      846            
  Partials        8        8            

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

@just-boris just-boris marked this pull request as ready for review September 10, 2024 12:06
@just-boris just-boris requested a review from a team as a code owner September 10, 2024 12:06
@just-boris just-boris removed the request for review from a team September 10, 2024 12:06
@just-boris just-boris added this pull request to the merge queue Sep 10, 2024
Merged via the queue into main with commit 04f1326 Sep 10, 2024
33 checks passed
@just-boris just-boris deleted the fix-flashbar-tests branch September 10, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants