From a34e67b6a1c693c1c2fc9ef56d20569b092c4dec Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 11 Nov 2021 18:04:35 +0530 Subject: [PATCH] path textbox --- .../src/lib/solidity-unit-testing.tsx | 76 +++++++++++++++++-- 1 file changed, 71 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 527ca5ca7b..31858b2665 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 @@ -6,6 +6,61 @@ import './css/style.css' export interface SolidityUnitTestingProps {} export const SolidityUnitTesting = (props: SolidityUnitTestingProps) => { + + const [defaultPath, setDefaultPath] = useState('tests') + + const handleTestDirInput = async (e:any) => { + console.log('handleTestDirInput--e-->', e) + + // let testDirInput = this.trimTestDirInput(this.inputPath.value) + // testDirInput = removeMultipleSlashes(testDirInput) + // if (testDirInput !== '/') testDirInput = removeTrailingSlashes(testDirInput) + // if (e.key === 'Enter') { + // this.inputPath.value = testDirInput + // if (await this.testTabLogic.pathExists(testDirInput)) { + // this.testTabLogic.setCurrentPath(testDirInput) + // this.updateForNewCurrent() + // return + // } + // } + + // if (testDirInput) { + // if (testDirInput.endsWith('/') && testDirInput !== '/') { + // testDirInput = removeTrailingSlashes(testDirInput) + // if (this.testTabLogic.currentPath === testDirInput.substr(0, testDirInput.length - 1)) { + // this.createTestFolder.disabled = true + // this.updateGenerateFileAction().disabled = true + // } + // this.updateDirList(testDirInput) + // } else { + // // If there is no matching folder in the workspace with entered text, enable Create button + // if (await this.testTabLogic.pathExists(testDirInput)) { + // this.createTestFolder.disabled = true + // this.updateGenerateFileAction().disabled = false + // } else { + // // Enable Create button + // this.createTestFolder.disabled = false + // // Disable Generate button because dir does not exist + // this.updateGenerateFileAction().disabled = true + // } + // } + // } else { + // this.updateDirList('/') + // } + } + + const handleEnter = async(e:any) => { + console.log('handleTestDirInput --e-->', e) + + // this.inputPath.value = removeMultipleSlashes(this.trimTestDirInput(this.inputPath.value)) + // if (this.createTestFolder.disabled) { + // if (await this.testTabLogic.pathExists(this.inputPath.value)) { + // this.testTabLogic.setCurrentPath(this.inputPath.value) + // this.updateForNewCurrent() + // } + // } + } + console.log('props---->', props) return (
@@ -13,13 +68,24 @@ export const SolidityUnitTesting = (props: SolidityUnitTestingProps) => {

Test your smart contract in Solidity.

Select directory to load and generate test files.

- {/*
+
- ${this.inputPath} - ${this.createTestFolder} - ${this.uiPathList} + + {/* ${this.createTestFolder} + ${this.uiPathList} */}
-
*/} +
{/*