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

fix: test failure on metrics test #25896

Closed
wants to merge 4 commits into from

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Jul 17, 2024

Description

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Jul 17, 2024
@pedronfigueiredo pedronfigueiredo self-assigned this Jul 17, 2024
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@pedronfigueiredo pedronfigueiredo changed the title fix: test failure on firefox fix: test failure on metrics test Jul 17, 2024
Copy link

@@ -36,7 +40,7 @@ export function withRedesignConfirmationFixtures(
.build(),
ganacheOptions: defaultGanacheOptions,
title,
testSpecificMock: mockSegment,
testSpecificMock: testSpecificMockOverride || mockSegment,
Copy link
Contributor

Choose a reason for hiding this comment

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

hi there 👋 the custom fixture function seems a bit confusing, but it looks like the test is failing because you are not passing the smartContract, meaning this won't be deployed. Then, when it tries to get the contract address, in the openDAppWithContract that is undefined:

TypeError: Cannot read properties of undefined (reading 'getContractAddress')


await createContractDeploymentTransaction(driver);
await confirmContractDeploymentTransaction(driver);
await openDAppWithContract(driver, contractRegistry, smartContract);
Copy link
Contributor

@seaona seaona Jul 18, 2024

Choose a reason for hiding this comment

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

nit: this function is a bit miss-leading, it is called openDappWithContract but what it's actually doing is:

  • unlocking MetaMask
  • fetching the address of the contract
  • going to the test dapp with the contract address

Since it's not introduced by this PR, it's not a blocker, but it could be improved in a subsequent PR

@pedronfigueiredo
Copy link
Contributor Author

I am skeptic of using withRedesignConfirmationFixtures in the metrics.spec.ts test. Adding smartContract and mocks as optional arguments after the assertions becomes quite confusing because we already have arguments before the assertions at the top.

Refactoring all the tests that use it to add the arguments before the test assertions would be too much work for a small optimisation.

Since the failure has now been resolved in #25520, I will close this PR.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants