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: Add regression tests for runtime preferences handling in multi-app-layout setup #3045

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

just-boris
Copy link
Member

Description

More regression tests for this PR #3022

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

How has this been tested?

Test changes only

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.

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.34%. Comparing base (4a35437) to head (4f9cd75).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3045   +/-   ##
=======================================
  Coverage   96.34%   96.34%           
=======================================
  Files         780      780           
  Lines       21923    21927    +4     
  Branches     7502     7502           
=======================================
+ Hits        21121    21126    +5     
- Misses        750      794   +44     
+ Partials       52        7   -45     

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


🚨 Try these New Features:

@@ -55,6 +55,7 @@ export default function () {
return (
<ScreenshotArea gutters={false}>
<AppLayout
{...{ __disableRuntimeDrawers: 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.

Moved this here to more accurately represent real-world use-case

type: 'global',
defaultActive: false,
resizable: true,
defaultSize: 320,

ariaLabels: {
closeButton: 'Close button',
content: 'Content',
content: 'Drawer with counter',
Copy link
Member Author

Choose a reason for hiding this comment

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

Improvement for manual testing. All drawers have the same circle icons, let's have different tooltips at least

@@ -53,7 +55,6 @@ describe.each(['classic', 'refresh', 'refresh-toolbar'] as Theme[])('%s', theme
test(
'renders according to defaultSize property',
setupTest({}, async page => {
await page.setWindowSize(viewports.desktop);
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed duplicated lines, this is in the shared setup

return;
}
const document = panelElement.ownerDocument;
Copy link
Member Author

Choose a reason for hiding this comment

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

Not really a functional change, but in our demo page setup the document points on the wrong frame and we need to account for that

Copy link
Member

Choose a reason for hiding this comment

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

Minor: shadowing the document variable rather than just calling it panelDocument could cause issues when we debug or refactor this code.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it this way to make the final diff shorter, but I can also rename if you find it more important

@@ -76,10 +76,38 @@ describe.each(['classic', 'refresh', 'refresh-toolbar'] as Theme[])('%s', theme
})
);

test(
'should persist runtime drawer preferences when switching between multiple app layouts',
Copy link
Member Author

@just-boris just-boris Nov 21, 2024

Choose a reason for hiding this comment

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

All changes were for the sake of writing this test

avinashbot
avinashbot previously approved these changes Nov 25, 2024
return;
}
const document = panelElement.ownerDocument;
Copy link
Member

Choose a reason for hiding this comment

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

Minor: shadowing the document variable rather than just calling it panelDocument could cause issues when we debug or refactor this code.

@just-boris just-boris added this pull request to the merge queue Nov 25, 2024
Merged via the queue into main with commit ad36547 Nov 25, 2024
38 checks passed
@just-boris just-boris deleted the multi-layout-updates branch November 25, 2024 12:40
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