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
a6481b0b
Commit
a6481b0b
authored
May 03, 2021
by
lianahus
Committed by
Aniket
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listen to event setWorkspace
parent
6ac6b7ee
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+11
-3
No files found.
apps/remix-ide/src/app/tabs/test-tab.js
View file @
a6481b0b
...
@@ -53,6 +53,8 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -53,6 +53,8 @@ module.exports = class TestTab extends ViewPlugin {
listenToEvents
()
{
listenToEvents
()
{
this
.
filePanel
.
event
.
register
(
'newTestFileCreated'
,
file
=>
{
this
.
filePanel
.
event
.
register
(
'newTestFileCreated'
,
file
=>
{
console
.
log
(
'newTestFileCreated'
)
var
testList
=
this
.
_view
.
el
.
querySelector
(
"[class^='testList']"
)
var
testList
=
this
.
_view
.
el
.
querySelector
(
"[class^='testList']"
)
var
test
=
this
.
createSingleTest
(
file
)
var
test
=
this
.
createSingleTest
(
file
)
testList
.
appendChild
(
test
)
testList
.
appendChild
(
test
)
...
@@ -60,6 +62,12 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -60,6 +62,12 @@ module.exports = class TestTab extends ViewPlugin {
this
.
data
.
selectedTests
.
push
(
file
)
this
.
data
.
selectedTests
.
push
(
file
)
})
})
this
.
on
(
'fileExplorers'
,
'setWorkspace'
,
async
()
=>
{
this
.
testTabLogic
.
setCurrentPath
(
this
.
defaultPath
)
this
.
inputPath
.
value
=
this
.
defaultPath
this
.
updateForNewCurrent
()
})
this
.
fileManager
.
events
.
on
(
'noFileSelected'
,
()
=>
{
this
.
fileManager
.
events
.
on
(
'noFileSelected'
,
()
=>
{
})
})
...
@@ -67,7 +75,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -67,7 +75,7 @@ module.exports = class TestTab extends ViewPlugin {
}
}
updateForNewCurrent
(
file
)
{
updateForNewCurrent
(
file
)
{
this
.
updateGenerateFileAction
(
file
)
this
.
updateGenerateFileAction
()
if
(
!
this
.
areTestsRunning
)
this
.
updateRunAction
(
file
)
if
(
!
this
.
areTestsRunning
)
this
.
updateRunAction
(
file
)
this
.
updateTestFileList
()
this
.
updateTestFileList
()
this
.
testTabLogic
.
getTests
((
error
,
tests
)
=>
{
this
.
testTabLogic
.
getTests
((
error
,
tests
)
=>
{
...
@@ -462,7 +470,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -462,7 +470,7 @@ module.exports = class TestTab extends ViewPlugin {
runBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
runBtn
.
setAttribute
(
'disabled'
,
'disabled'
)
}
}
updateGenerateFileAction
(
currentFile
)
{
updateGenerateFileAction
()
{
const
el
=
yo
`
const
el
=
yo
`
<button
<button
class="btn border w-50"
class="btn border w-50"
...
@@ -588,7 +596,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -588,7 +596,7 @@ module.exports = class TestTab extends ViewPlugin {
if
(
testDirInput
)
{
if
(
testDirInput
)
{
if
(
testDirInput
.
endsWith
(
'/'
))
{
if
(
testDirInput
.
endsWith
(
'/'
))
{
// check if the options list already contains the options
// check if the options list already contains the options
if
(
this
.
testTabLogic
.
currentPath
===
testDirInput
)
{
if
(
this
.
testTabLogic
.
currentPath
===
testDirInput
.
substr
(
0
,
testDirInput
.
length
-
1
)
)
{
this
.
createTestFolder
.
disabled
=
true
this
.
createTestFolder
.
disabled
=
true
this
.
updateGenerateFileAction
().
disabled
=
true
this
.
updateGenerateFileAction
().
disabled
=
true
}
}
...
...
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