mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
96c00df6f0
Three e2e tests have been updated to fix a possible race condition causing intermittent e2e test failures. In each of the updated tests, the test checks the current network. The check is performed as a two-step process: locate the current network element, then check the text to ensure it's correct. This fails when the test driver finds the element before it re-renders. If the test runs too quickly, it compares the text before the switch is shown on screen, and the test fails. Instead the tests use the element locator to describe what they want. This tells the test driver to keep looking until the conditions are met, ensuring the test doesn't fail unless the network switch takes longer than the default timeout (which should not happen). This is a good example of why we should avoid using assertions on elements in e2e tests. Express your assertions as locators instead to make the test more resilient in the case where the test runs before the next render. |
||
---|---|---|
.. | ||
data | ||
e2e | ||
helpers | ||
jest | ||
lib | ||
mocks | ||
stub | ||
unit-global | ||
env.js | ||
merge-coverage.js | ||
run-unit-tests.js | ||
setup.js |