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

Add support for custom dialogs in snaps-jest #2526

Merged
merged 6 commits into from
Jul 1, 2024

Conversation

GuillaumeRx
Copy link
Contributor

This PR adds the support for the new default type dialog.

  • Add a new dialog to the dialog test snap.
  • Add logic to handle custom dialogs.
  • Add assertion utils

@GuillaumeRx GuillaumeRx requested a review from a team as a code owner June 28, 2024 11:08
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.93%. Comparing base (7a4cb03) to head (665aee2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2526      +/-   ##
==========================================
+ Coverage   93.90%   93.93%   +0.03%     
==========================================
  Files         455      455              
  Lines        9477     9531      +54     
  Branches     1447     1458      +11     
==========================================
+ Hits         8899     8953      +54     
  Misses        578      578              

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

packages/snaps-jest/src/test-utils/controller.ts Outdated Show resolved Hide resolved
packages/snaps-jest/src/types.ts Outdated Show resolved Hide resolved
@@ -141,6 +141,7 @@ describe('onRpcRequest', () => {
});

const ui = await response.getInterface();
Copy link
Member

Choose a reason for hiding this comment

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

Now that I think about it, it seems easier to specify the expected type in getInterface rather than having to assert all the time.

Suggested change
const ui = await response.getInterface();
const ui = await response.getInterface('confirmation');
// `ui` is now `ConfirmationDialog` type

I can take care of this in a separate PR.

@GuillaumeRx GuillaumeRx force-pushed the gr/support-resolvable-interfaces branch from 0238f1c to 665aee2 Compare July 1, 2024 10:11
@GuillaumeRx GuillaumeRx merged commit 882232c into main Jul 1, 2024
156 checks passed
@GuillaumeRx GuillaumeRx deleted the gr/support-resolvable-interfaces branch July 1, 2024 10:17
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