From 9494e981d4edc1f7a9b30adc8d4c0857091558b0 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 10 Dec 2021 19:30:37 +0530 Subject: [PATCH] highlight location --- .../src/lib/solidity-unit-testing.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 8c1dc8e2c6..f8c2f2a4d3 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -233,6 +233,8 @@ export const SolidityUnitTesting = (props: any) => { } const highlightLocation = async (location: any, runningTests: any, fileName: any) => { + console.log('Inside highlightLocation---runningTests-->', runningTests) + console.log('Inside highlightLocation---fileName-->', fileName) if (location) { var split = location.split(':') var file = split[2] @@ -250,7 +252,8 @@ export const SolidityUnitTesting = (props: any) => { } } - const showTestsResult = () => { + const showTestsResult = (runningTests: any) => { + console.log('runningTests---->', runningTests) setTestsOutput([]) let filenames = Object.keys(testsResultByFilename) for(const filename of filenames) { @@ -284,6 +287,7 @@ export const SolidityUnitTesting = (props: any) => { setTestsOutput(prevCards => ([...prevCards, ContractCard])) // show tests for(const test of tests) { + console.log('test---->', test) if (test.type === 'testPass') { if (test.hhLogs && test.hhLogs.length) printHHLogs(test.hhLogs, test.value) const testPassCard: any = ( @@ -306,7 +310,7 @@ export const SolidityUnitTesting = (props: any) => { const testFailCard1: any = (
highlightLocation(test.location, runningTests, test.filename)} + onClick={() => highlightLocation(test.location, runningTests, test.filename)} >
✘ {test.value} @@ -322,8 +326,8 @@ export const SolidityUnitTesting = (props: any) => { const expected = test.assertMethod === 'ok' ? '\'true\'' : test.expected const testFailCard2: any = (
highlightLocation(result.location, runningTests, result.filename)} + id={"UTContext" + test.context} + onClick={() => highlightLocation(test.location, runningTests, test.filename)} >
✘ {test.value} @@ -383,7 +387,7 @@ export const SolidityUnitTesting = (props: any) => { testsResultByFilename[result.filename][result.value] = [] } else testsResultByFilename[result.filename][result.context].push(result) - showTestsResult() + showTestsResult(runningTests) } }