Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

test: fix test errors for WalletDetails #2618

Closed
wants to merge 1 commit into from

Conversation

goga-m
Copy link
Contributor

@goga-m goga-m commented Aug 6, 2020

Summary

Fix WalletDetails timeout error.
The error originates from async operations inside WalletDetails page that are not consistent in timing and result to randomly exceed 5sec timeout limit. It will require a deeper investigation and further refactoring in page component and tests, and this is considered a temporary fix until the WalletDetails page is finalized.

FAIL src/domains/wallet/pages/WalletDetails/WalletDetails.test.tsx (70.248s, 114 MB heap size)
  ● WalletDetails › should render
    thrown: "Exceeded timeout of 5000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
      102 | 
      103 | describe("WalletDetails", () => {
    > 104 |     it("should render", async () => {
          |     ^
      105 |         const { asFragment, getByTestId } = await renderPage();
      106 | 
      107 |         await waitFor(() => expect(getByTestId("WalletHeader__address-publickey")).toHaveTextContent(wallet.address()));
      at src/domains/wallet/pages/WalletDetails/WalletDetails.test.tsx:104:2
      at Object.<anonymous> (src/domains/wallet/pages/WalletDetails/WalletDetails.test.tsx:103:1)

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@goga-m goga-m requested a review from faustbrian as a code owner August 6, 2020 12:02
@ghost ghost added Complexity: Low Less than 64 lines changed. Test: Unit The issue or pull request is related to unit tests for testing individual elements. labels Aug 6, 2020
@codecov
Copy link

codecov bot commented Aug 6, 2020

Codecov Report

Merging #2618 into 3.0-react will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##           3.0-react     #2618     +/-   ##
=============================================
  Coverage     100.00%   100.00%             
=============================================
  Files             24       249    +225     
  Lines            142      2990   +2848     
  Branches          18       541    +523     
=============================================
+ Hits             142      2990   +2848     
Flag Coverage Δ
#unit 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/app/components/Button/Button.tsx 100.00% <ø> (ø)
src/app/App.tsx 100.00% <100.00%> (ø)
src/app/components/Address/Address.tsx 100.00% <100.00%> (ø)
src/app/components/Alert/Alert.tsx 100.00% <100.00%> (ø)
src/app/components/Amount/Amount.tsx 100.00% <100.00%> (ø)
src/app/components/Avatar/Avatar.tsx 100.00% <100.00%> (ø)
src/app/components/Badge/Badge.tsx 100.00% <100.00%> (ø)
src/app/components/Breadcrumbs/Breadcrumbs.tsx 100.00% <100.00%> (ø)
src/app/components/Card/Card.tsx 100.00% <100.00%> (ø)
src/app/components/Card/CardControl.tsx 100.00% <100.00%> (ø)
... and 271 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1cd404d...411281a. Read the comment docs.

@faustbrian
Copy link
Contributor

Will close this so the sporadically failing test serves as a reminder to properly look into it and fix it for good.

@faustbrian faustbrian closed this Aug 6, 2020
@faustbrian faustbrian deleted the fix/wallet-details-test-errors branch August 9, 2020 03:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Complexity: Low Less than 64 lines changed. Test: Unit The issue or pull request is related to unit tests for testing individual elements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants