Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
80b7a7e2
Commit
80b7a7e2
authored
Apr 26, 2021
by
lianahus
Committed by
Aniket
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uodate current on enter
parent
908d897f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
5 deletions
+33
-5
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+26
-5
testTab.js
apps/remix-ide/src/app/tabs/testTab/testTab.js
+7
-0
No files found.
apps/remix-ide/src/app/tabs/test-tab.js
View file @
80b7a7e2
...
...
@@ -69,6 +69,7 @@ module.exports = class TestTab extends ViewPlugin {
updateForNewCurrent
(
file
)
{
this
.
updateGenerateFileAction
(
file
)
if
(
!
this
.
areTestsRunning
)
this
.
updateRunAction
(
file
)
this
.
updateTestFileList
()
this
.
testTabLogic
.
getTests
((
error
,
tests
)
=>
{
if
(
error
)
return
tooltip
(
error
)
this
.
data
.
allTests
=
tests
...
...
@@ -566,15 +567,24 @@ module.exports = class TestTab extends ViewPlugin {
else
return
input
.
trim
()
}
doesOptionAlready
Added
(
text
)
{
path
Added
(
text
)
{
for
(
const
option
of
this
.
uiPathList
.
querySelectorAll
(
'option'
))
{
if
(
option
.
innerHTML
===
text
)
return
true
}
return
false
}
handleTestDirInput
(
)
{
async
handleTestDirInput
(
e
)
{
const
testDirInput
=
this
.
trimTestDirInput
(
this
.
inputPath
.
value
)
if
(
e
.
key
===
'Enter'
)
{
this
.
inputPath
.
value
=
this
.
trimTestDirInput
(
testDirInput
)
if
(
await
this
.
testTabLogic
.
pathExists
(
testDirInput
))
{
this
.
testTabLogic
.
setCurrentPath
(
testDirInput
)
this
.
updateForNewCurrent
()
return
}
}
if
(
testDirInput
)
{
if
(
testDirInput
.
endsWith
(
'/'
))
{
// check if the options list already contains the options
...
...
@@ -585,7 +595,7 @@ module.exports = class TestTab extends ViewPlugin {
this
.
updateDirList
(
testDirInput
)
}
else
{
// If there is no matching folder in the workspace with entered text, enable Create button
if
(
this
.
doesOptionAlready
Added
(
testDirInput
))
{
if
(
this
.
path
Added
(
testDirInput
))
{
this
.
createTestFolder
.
disabled
=
true
this
.
updateGenerateFileAction
().
disabled
=
false
}
else
{
...
...
@@ -614,8 +624,19 @@ module.exports = class TestTab extends ViewPlugin {
data-id="uiPathInput"
name="utPath"
style="background-image: var(--primary);"
onkeyup=
${(
e
)
=>
this
.
handleTestDirInput
()}
onchange=
${(
e
)
=>
{
if
(
!
this
.
createTestFolder
.
disabled
)
this
.
handleCreateFolder
()
}}
onkeyup=
${(
e
)
=>
this
.
handleTestDirInput
(
e
)}
onchange=
${(
e
)
=>
{
console
.
log
(
"onchange"
)
if
(
!
this
.
createTestFolder
.
disabled
)
return
// this.handleCreateFolder()
else
{
this
.
inputPath
.
value
=
this
.
trimTestDirInput
(
this
.
inputPath
.
value
)
if
(
this
.
testTabLogic
.
pathExists
(
this
.
inputPath
.
value
))
{
this
.
inputPath
.
value
=
this
.
trimTestDirInput
(
this
.
inputPath
.
value
)
this
.
testTabLogic
.
setCurrentPath
(
this
.
inputPath
.
value
)
this
.
updateForNewCurrent
()
}
}
}}
/>
`
this
.
createTestFolder
=
yo
`
...
...
apps/remix-ide/src/app/tabs/testTab/testTab.js
View file @
80b7a7e2
...
...
@@ -21,6 +21,13 @@ class TestTabLogic {
fileProvider
.
exists
(
path
,
(
e
,
res
)
=>
{
if
(
!
res
)
fileProvider
.
createDir
(
path
)
})
}
pathExists
(
path
)
{
// Checking to ignore the value which contains only whitespaces
if
(
!
path
||
!
(
/
\S
/
.
test
(
path
)))
return
const
fileProvider
=
this
.
fileManager
.
fileProviderOf
(
path
.
split
(
'/'
)[
0
])
return
fileProvider
.
exists
(
path
,
(
e
,
res
)
=>
{
return
res
})
}
generateTestFile
()
{
let
fileName
=
this
.
fileManager
.
currentFile
()
const
hasCurrent
=
!!
fileName
&&
this
.
fileManager
.
currentFile
().
split
(
'.'
).
pop
().
toLowerCase
()
===
'sol'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment