From d8a8c8faed445850d7bbc2c86c3fe0b3bdea31e3 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 3 Sep 2020 13:49:21 +0200 Subject: [PATCH] style fix on UI and test failore UI --- apps/remix-ide/src/app/tabs/test-tab.js | 38 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 4c84777fab..314888bcb2 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -149,25 +149,35 @@ module.exports = class TestTab extends ViewPlugin { `) } else if (result.type === 'testFailure') { - const preposition = result.assertMethod === 'equal' || result.assertMethod === 'notEqual' ? 'to' : '' - const method = result.assertMethod === 'ok' ? '' : result.assertMethod - const expected = result.assertMethod === 'ok' ? `'true'` : result.expected - this.testsOutput.appendChild(yo` + if (!result.assertMethod) { + this.testsOutput.appendChild(yo`
✘ ${result.value} Error Message: - "${result.errMsg}" - Asserttion: -
- Expected value should be -
${method}
-
${preposition} ${expected}
-
- Received value: - ${result.returned} - Skipping the rest... + "${result.errMsg}"
`) + } else { + const preposition = result.assertMethod === 'equal' || result.assertMethod === 'notEqual' ? 'to' : '' + const method = result.assertMethod === 'ok' ? '' : result.assertMethod + const expected = result.assertMethod === 'ok' ? `'true'` : result.expected + this.testsOutput.appendChild(yo` +
+ ✘ ${result.value} + Error Message: + "${result.errMsg}" + Asserttion: +
+ Expected value should be +
${method}
+
${preposition} ${expected}
+
+ Received value: + ${result.returned} + Skipping the rest... +
+ `) + } } }