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
fb1e8350
Commit
fb1e8350
authored
Sep 28, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed workspace test, ensure open files are closed before workspace creation
parent
ebf21ed8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
21 deletions
+17
-21
workspace.test.ts
apps/remix-ide-e2e/src/tests/workspace.test.ts
+8
-15
fileManager.js
apps/remix-ide/src/app/files/fileManager.js
+8
-5
workspace.ts
libs/remix-ui/workspace/src/lib/actions/workspace.ts
+1
-1
No files found.
apps/remix-ide-e2e/src/tests/workspace.test.ts
View file @
fb1e8350
...
@@ -38,8 +38,8 @@ module.exports = {
...
@@ -38,8 +38,8 @@ module.exports = {
.
waitForElementVisible
(
'[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span'
)
.
waitForElementVisible
(
'[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span'
)
// eslint-disable-next-line dot-notation
// eslint-disable-next-line dot-notation
.
execute
(
function
()
{
document
.
querySelector
(
'*[data-id="modalDialogCustomPromptTextCreate"]'
)[
'value'
]
=
'workspace_name'
})
.
execute
(
function
()
{
document
.
querySelector
(
'*[data-id="modalDialogCustomPromptTextCreate"]'
)[
'value'
]
=
'workspace_name'
})
.
pause
(
1000
)
.
waitForElementVisible
(
'[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok'
)
.
click
(
'
span[data-id="workspacesModalDialog-modal-footer-ok-react"]
'
)
.
click
(
'
[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok
'
)
.
waitForElementVisible
(
'*[data-id="treeViewLitreeViewItemtests"]'
)
.
waitForElementVisible
(
'*[data-id="treeViewLitreeViewItemtests"]'
)
.
pause
(
1000
)
.
pause
(
1000
)
.
addFile
(
'test.sol'
,
{
content
:
'test'
})
.
addFile
(
'test.sol'
,
{
content
:
'test'
})
...
@@ -48,11 +48,8 @@ module.exports = {
...
@@ -48,11 +48,8 @@ module.exports = {
.
waitForElementVisible
(
'*[data-id="modalDialogCustomPromptTextCreate"]'
)
.
waitForElementVisible
(
'*[data-id="modalDialogCustomPromptTextCreate"]'
)
// eslint-disable-next-line dot-notation
// eslint-disable-next-line dot-notation
.
execute
(
function
()
{
document
.
querySelector
(
'*[data-id="modalDialogCustomPromptTextCreate"]'
)[
'value'
]
=
'workspace_name_1'
})
.
execute
(
function
()
{
document
.
querySelector
(
'*[data-id="modalDialogCustomPromptTextCreate"]'
)[
'value'
]
=
'workspace_name_1'
})
.
waitForElementVisible
(
'span[data-id="workspacesModalDialog-modal-footer-ok-react"]'
)
.
waitForElementVisible
(
'[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok]'
)
// eslint-disable-next-line dot-notation
.
click
(
'[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok'
)
.
execute
(
function
()
{
document
.
querySelector
(
'span[data-id="workspacesModalDialog-modal-footer-ok-react"]'
)
})
.
pause
(
2000
)
.
click
(
'span[data-id="workspacesModalDialog-modal-footer-ok-react"]'
)
.
waitForElementVisible
(
'*[data-id="treeViewLitreeViewItemtests"]'
)
.
waitForElementVisible
(
'*[data-id="treeViewLitreeViewItemtests"]'
)
.
pause
(
2000
)
.
pause
(
2000
)
.
waitForElementNotPresent
(
'*[data-id="treeViewLitreeViewItemtest.sol"]'
)
.
waitForElementNotPresent
(
'*[data-id="treeViewLitreeViewItemtest.sol"]'
)
...
@@ -68,10 +65,8 @@ module.exports = {
...
@@ -68,10 +65,8 @@ module.exports = {
.
waitForElementVisible
(
'*[data-id="modalDialogCustomPromptTextRename"]'
)
.
waitForElementVisible
(
'*[data-id="modalDialogCustomPromptTextRename"]'
)
// eslint-disable-next-line dot-notation
// eslint-disable-next-line dot-notation
.
execute
(
function
()
{
document
.
querySelector
(
'*[data-id="modalDialogCustomPromptTextRename"]'
)[
'value'
]
=
'workspace_name_renamed'
})
.
execute
(
function
()
{
document
.
querySelector
(
'*[data-id="modalDialogCustomPromptTextRename"]'
)[
'value'
]
=
'workspace_name_renamed'
})
.
pause
(
2000
)
.
waitForElementPresent
(
'[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok'
)
.
waitForElementPresent
(
'span[data-id="workspacesModalDialog-modal-footer-ok-react"]'
)
.
click
(
'[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok'
)
.
click
(
'span[data-id="workspacesModalDialog-modal-footer-ok-react"]'
)
.
pause
(
2000
)
.
click
(
'*[data-id="workspacesSelect"] option[value="workspace_name_1"]'
)
.
click
(
'*[data-id="workspacesSelect"] option[value="workspace_name_1"]'
)
.
pause
(
2000
)
.
pause
(
2000
)
.
waitForElementNotPresent
(
'*[data-id="treeViewLitreeViewItemtest.sol"]'
)
.
waitForElementNotPresent
(
'*[data-id="treeViewLitreeViewItemtest.sol"]'
)
...
@@ -84,10 +79,8 @@ module.exports = {
...
@@ -84,10 +79,8 @@ module.exports = {
browser
browser
.
click
(
'*[data-id="workspacesSelect"] option[value="workspace_name_1"]'
)
.
click
(
'*[data-id="workspacesSelect"] option[value="workspace_name_1"]'
)
.
click
(
'*[data-id="workspaceDelete"]'
)
// delete workspace_name_1
.
click
(
'*[data-id="workspaceDelete"]'
)
// delete workspace_name_1
.
waitForElementVisible
(
'[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span'
)
.
waitForElementVisible
(
'[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok'
)
.
pause
(
2000
)
.
click
(
'[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok'
)
.
click
(
'[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span'
)
.
pause
(
2000
)
.
waitForElementNotPresent
(
'*[data-id="workspacesSelect"] option[value="workspace_name_1"]'
)
.
waitForElementNotPresent
(
'*[data-id="workspacesSelect"] option[value="workspace_name_1"]'
)
.
end
()
.
end
()
},
},
...
...
apps/remix-ide/src/app/files/fileManager.js
View file @
fb1e8350
...
@@ -458,11 +458,14 @@ class FileManager extends Plugin {
...
@@ -458,11 +458,14 @@ class FileManager extends Plugin {
closeAllFiles
()
{
closeAllFiles
()
{
// TODO: Only keep `this.emit` (issue#2210)
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'filesAllClosed'
)
return
new
Promise
((
resolve
)
=>
{
this
.
events
.
emit
(
'filesAllClosed'
)
this
.
emit
(
'filesAllClosed'
)
for
(
const
file
in
this
.
openedFiles
)
{
this
.
events
.
emit
(
'filesAllClosed'
)
this
.
closeFile
(
file
)
for
(
const
file
in
this
.
openedFiles
)
{
}
this
.
closeFile
(
file
)
}
resolve
(
true
)
})
}
}
closeFile
(
name
)
{
closeFile
(
name
)
{
...
...
libs/remix-ui/workspace/src/lib/actions/workspace.ts
View file @
fb1e8350
...
@@ -35,11 +35,11 @@ export const addInputField = async (type: 'file' | 'folder', path: string) => {
...
@@ -35,11 +35,11 @@ export const addInputField = async (type: 'file' | 'folder', path: string) => {
}
}
export
const
createWorkspace
=
async
(
workspaceName
:
string
)
=>
{
export
const
createWorkspace
=
async
(
workspaceName
:
string
)
=>
{
await
plugin
.
fileManager
.
closeAllFiles
()
const
promise
=
createWorkspaceTemplate
(
workspaceName
,
'default-template'
)
const
promise
=
createWorkspaceTemplate
(
workspaceName
,
'default-template'
)
dispatch
(
createWorkspaceRequest
(
promise
))
dispatch
(
createWorkspaceRequest
(
promise
))
promise
.
then
(
async
()
=>
{
promise
.
then
(
async
()
=>
{
await
plugin
.
fileManager
.
closeAllFiles
()
dispatch
(
createWorkspaceSuccess
(
workspaceName
))
dispatch
(
createWorkspaceSuccess
(
workspaceName
))
await
loadWorkspacePreset
(
'default-template'
)
await
loadWorkspacePreset
(
'default-template'
)
// await switchToWorkspace(workspaceName)
// await switchToWorkspace(workspaceName)
...
...
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