Skip to content

Commit ba26d55

Browse files
authored
Merge branch 'master' into fix_theme_lowercase
2 parents 6ffaee8 + d8655f3 commit ba26d55

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

libs/remix-ui/solidity-unit-testing/src/lib/logic/testTabLogic.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,20 @@ export class TestTabLogic {
2121
this.currentPath = this.helper.removeMultipleSlashes(this.helper.removeTrailingSlashes(path))
2222
}
2323

24-
generateTestFolder (path:string) {
24+
async generateTestFolder (path:string) {
2525
// Todo move this check to File Manager after refactoring
2626
// Checking to ignore the value which contains only whitespaces
2727
if (!path || !(/\S/.test(path))) return
2828
path = this.helper.removeMultipleSlashes(path)
2929
const fileProvider = this.fileManager.fileProviderOf(path.split('/')[0])
30-
fileProvider.exists(path).then((res: boolean) => {
31-
if (!res) fileProvider.createDir(path)
32-
})
30+
if(!await fileProvider.exists(path)) fileProvider.createDir(path)
3331
}
3432

3533
async pathExists (path: string) {
3634
// Checking to ignore the value which contains only whitespaces
3735
if (!path || !(/\S/.test(path))) return
3836
const fileProvider = this.fileManager.fileProviderOf(path.split('/')[0])
39-
const res = await fileProvider.exists(path, (e: Error, res: boolean) => { return res })
40-
return res
37+
return await fileProvider.exists(path)
4138
}
4239

4340
// eslint-disable-next-line @typescript-eslint/no-explicit-any

libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d
222222
if (path !== '/') path = helper.removeTrailingSlashes(path)
223223
if (inputPath === '') inputPath = defaultPath
224224
setInputPathValue(path)
225-
testTabLogic.generateTestFolder(inputPath)
225+
await testTabLogic.generateTestFolder(inputPath)
226+
setToasterMsg('Folder created successfully')
226227
setDisableCreateButton(true)
227228
setDisableGenerateButton(false)
228229
testTabLogic.setCurrentPath(inputPath)
@@ -672,6 +673,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d
672673
value={inputPathValue}
673674
title="Press 'Enter' to change the path for test files."
674675
style={{ backgroundImage: "var(--primary)" }}
676+
onKeyDown={() => { if (inputPathValue === '/') setInputPathValue('')} }
675677
onKeyUp={handleTestDirInput}
676678
onChange={handleEnter}
677679
onClick = {() => { if (inputPathValue === '/') setInputPathValue('')} }

0 commit comments

Comments
 (0)