testFailCard2

pull/1862/head
Aniket-Engg 3 years ago committed by Aniket
parent 24148da046
commit 6e50a042d3
  1. 60
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx

@ -230,7 +230,7 @@ export const SolidityUnitTesting = (props: any) => {
} else if (result.type === 'testFailure') { } else if (result.type === 'testFailure') {
// if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) // if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value)
if (!result.assertMethod) { if (!result.assertMethod) {
const testFailCard: any = (<div const testFailCard1: any = (<div
className="bg-light mb-2 px-2 testLog d-flex flex-column text-danger border-0" className="bg-light mb-2 px-2 testLog d-flex flex-column text-danger border-0"
id={"UTContext" + result.context} id={"UTContext" + result.context}
// onClick=${() => this.highlightLocation(result.location, runningTests, result.filename)} // onClick=${() => this.highlightLocation(result.location, runningTests, result.filename)}
@ -242,36 +242,34 @@ export const SolidityUnitTesting = (props: any) => {
<span className="text-dark">Error Message:</span> <span className="text-dark">Error Message:</span>
<span className="pb-2 text-break">"{result.errMsg}"</span> <span className="pb-2 text-break">"{result.errMsg}"</span>
</div>) </div>)
setTestsOutput(prevCards => ([...prevCards, testFailCard])) setTestsOutput(prevCards => ([...prevCards, testFailCard1]))
} } else {
// else { const preposition = result.assertMethod === 'equal' || result.assertMethod === 'notEqual' ? 'to' : ''
// const preposition = result.assertMethod === 'equal' || result.assertMethod === 'notEqual' ? 'to' : '' const method = result.assertMethod === 'ok' ? '' : result.assertMethod
// const method = result.assertMethod === 'ok' ? '' : result.assertMethod const expected = result.assertMethod === 'ok' ? '\'true\'' : result.expected
// const expected = result.assertMethod === 'ok' ? '\'true\'' : result.expected const testFailCard2: any = (<div
// this.testsOutput.appendChild(yo` className="bg-light mb-2 px-2 testLog d-flex flex-column text-danger border-0"
// <div id="UTContext${result.context}"
// class="bg-light mb-2 px-2 ${css.testLog} d-flex flex-column text-danger border-0" // onclick=${() => this.highlightLocation(result.location, runningTests, result.filename)}
// id="UTContext${result.context}" >
// onclick=${() => this.highlightLocation(result.location, runningTests, result.filename)} <div className="d-flex my-1 align-items-start justify-content-between">
// > <span> {result.value}</span>
// <div class="d-flex my-1 align-items-start justify-content-between"> {/* ${debugBtn} */}
// <span> ✘ ${result.value}</span> </div>
// ${debugBtn} <span className="text-dark">Error Message:</span>
// </div> <span className="pb-2 text-break">"{result.errMsg}"</span>
// <span class="text-dark">Error Message:</span> <span className="text-dark">Assertion:</span>
// <span class="pb-2 text-break">"${result.errMsg}"</span> <div className="d-flex flex-wrap">
// <span class="text-dark">Assertion:</span> <span>Expected value should be</span>
// <div class="d-flex flex-wrap"> <div className="mx-1 font-weight-bold">{method}</div>
// <span>Expected value should be</span> <div>{preposition} {expected}</div>
// <div class="mx-1 font-weight-bold">${method}</div> </div>
// <div>${preposition} ${expected}</div> <span className="text-dark">Received value:</span>
// </div> <span>{result.returned}</span>
// <span class="text-dark">Received value:</span> <span className="text-dark text-sm pb-2">Skipping the remaining tests of the function.</span>
// <span>${result.returned}</span> </div>)
// <span class="text-dark text-sm pb-2">Skipping the remaining tests of the function.</span> setTestsOutput(prevCards => ([...prevCards, testFailCard2]))
// </div> }
// `)
// }
} }
//else if (result.type === 'logOnly') { //else if (result.type === 'logOnly') {
// if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) // if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value)

Loading…
Cancel
Save