poanetwork / token-wizard

(Discontinued) TokenWizard is an DApp to create and manage crowdsale and token contracts using a simple UI
MIT License
384 stars 215 forks source link

(Test) Home Component test case for 'stepOne' navigation #1129

Closed fernandomg closed 5 years ago

fernandomg commented 5 years ago

Problem: When testing Home component (see PR #1122), the method getCrowdsaleAssets fails with the following error.

(node:28260) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'URL' of null
    at new XMLHttpRequest (/token-wizard/node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js:116:39)
    at /token-wizard/src/utils/utils.js:81:5054
    at new Promise (<anonymous>)
    at fetchFile (/token-wizard/src/utils/utils.js:81:4900)
    at setFlatFileContentToState (/token-wizard/src/utils/utils.js:81:4778)
    at _callee2$ (/token-wizard/src/stores/utils.js:60:129)
    at tryCatch (/token-wizard/node_modules/regenerator-runtime/runtime.js:65:40)

Solution: Review and refactor to prevent the Unhandled PromiseRejectionWarning message.

Note: There's a commented out test case that should pass if this issue is fixed (should navigate to StepOne)