From 80045af191183573d786dd8095671399c84a4648 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 28 Dec 2021 11:49:49 +0530 Subject: [PATCH] toaster for error --- .../src/lib/solidity-unit-testing.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 d759fdfcfd..63de9bfb57 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 @@ -2,6 +2,7 @@ import React, { useState, useRef, useEffect } from 'react' // eslint-disable-lin import { eachOfSeries } from 'async' // eslint-disable-line import { canUseWorker, urlFromVersion } from '@remix-project/remix-solidity' import { Renderer } from '@remix-ui/renderer' // eslint-disable-line +import { Toaster } from '@remix-ui/toaster' // eslint-disable-line import { format } from 'util' import './css/style.css' @@ -21,6 +22,8 @@ export const SolidityUnitTesting = (props: Record) => { const { testTabLogic } = testTab const [defaultPath, setDefaultPath] = useState('tests') + const [toasterMsg, setToasterMsg] = useState('') + const [disableCreateButton, setDisableCreateButton] = useState(true) const [disableGenerateButton, setDisableGenerateButton] = useState(false) const [disableStopButton, setDisableStopButton] = useState(true) @@ -87,7 +90,7 @@ export const SolidityUnitTesting = (props: Record) => { clearResults() try { testTabLogic.getTests(async (error: any, tests: any) => { - // if (error) return tooltip(error) + if (error) return setToasterMsg(error) allTests.current = tests selectedTests.current = [...allTests.current] updateTestFileList() @@ -120,7 +123,7 @@ export const SolidityUnitTesting = (props: Record) => { testTab.on('filePanel', 'newTestFileCreated', async (file: string) => { try { testTabLogic.getTests((error: any, tests: any) => { - // if (error) return tooltip(error) + if (error) return setToasterMsg(error) allTests.current = tests selectedTests.current = [...allTests.current] updateTestFileList() @@ -627,6 +630,7 @@ export const SolidityUnitTesting = (props: Record) => { return (
+

Test your smart contract in Solidity.

Select directory to load and generate test files.