Fix failing tests

pull/1140/head
ioedeveloper 4 years ago
parent 383ac9311f
commit 8dfeb658a9
  1. 6
      apps/remix-ide-e2e/src/commands/addFile.ts
  2. 12
      apps/remix-ide-e2e/src/tests/fileExplorer.test.ts
  3. 6
      apps/remix-ide-e2e/src/tests/gist.spec.ts
  4. 4
      libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
  5. 2
      libs/remix-ui/file-explorer/src/lib/reducers/fileSystem.ts

@ -18,9 +18,9 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory
.click('.newFile') .click('.newFile')
.waitForElementContainsText('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"]', '', 60000) .waitForElementContainsText('*[data-id$="/blank"]', '', 60000)
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', name) .sendKeys('*[data-id$="/blank"] .remixui_items', name)
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', browser.Keys.ENTER) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER)
.pause(2000) .pause(2000)
.waitForElementVisible(`li[data-id="treeViewLitreeViewItem${name}"]`, 60000) .waitForElementVisible(`li[data-id="treeViewLitreeViewItem${name}"]`, 60000)
.setEditorValue(content.content) .setEditorValue(content.content)

@ -22,9 +22,9 @@ module.exports = {
.click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory
.click('*[data-id="fileExplorerNewFilecreateNewFile"]') .click('*[data-id="fileExplorerNewFilecreateNewFile"]')
.pause(1000) .pause(1000)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"]') .waitForElementVisible('*[data-id$="/blank"]')
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', '5_New_contract.sol') .sendKeys('*[data-id$="/blank"] .remixui_items', '5_New_contract.sol')
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', browser.Keys.ENTER) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER)
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]', 7000) .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]', 7000)
}, },
@ -49,9 +49,9 @@ module.exports = {
.click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory
.click('[data-id="fileExplorerNewFilecreateNewFolder"]') .click('[data-id="fileExplorerNewFilecreateNewFolder"]')
.pause(1000) .pause(1000)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"]') .waitForElementVisible('*[data-id$="/blank"]')
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', 'Browser_Tests') .sendKeys('*[data-id$="/blank"] .remixui_items', 'Browser_Tests')
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', browser.Keys.ENTER) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]')
}, },

@ -29,9 +29,9 @@ module.exports = {
.waitForElementVisible('*[data-id="fileExplorerNewFilecreateNewFolder"]') .waitForElementVisible('*[data-id="fileExplorerNewFilecreateNewFolder"]')
.click('[data-id="fileExplorerNewFilecreateNewFolder"]') .click('[data-id="fileExplorerNewFilecreateNewFolder"]')
.pause(1000) .pause(1000)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"]') .waitForElementVisible('*[data-id$="/blank"]')
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', 'Browser_Tests') .sendKeys('*[data-id$="/blank"] .remixui_items', 'Browser_Tests')
.sendKeys('*[data-id="treeViewLitreeViewItemdefault_workspace/blank"] .remixui_items', browser.Keys.ENTER) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]')
.addFile('File.sol', { content: '' }) .addFile('File.sol', { content: '' })
.click('*[data-id="fileExplorerNewFilepublishToGist"]') .click('*[data-id="fileExplorerNewFilepublishToGist"]')

@ -110,7 +110,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
if (props.filesProvider) { if (props.filesProvider) {
init(props.filesProvider, props.name, props.plugin, props.registry)(dispatch) init(props.filesProvider, props.name, props.plugin, props.registry)(dispatch)
} }
}, [props.filesProvider]) }, [props.filesProvider, props.name])
useEffect(() => { useEffect(() => {
const provider = fileSystem.provider.provider const provider = fileSystem.provider.provider
@ -118,7 +118,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
if (provider) { if (provider) {
fetchDirectory(provider, props.name)(dispatch) fetchDirectory(provider, props.name)(dispatch)
} }
}, [fileSystem.provider.provider]) }, [fileSystem.provider.provider, props.name])
useEffect(() => { useEffect(() => {
if (fileSystem.notification.message) { if (fileSystem.notification.message) {

@ -259,7 +259,7 @@ const resolveDirectory = (root, path: string, files, content) => {
isDirectory: true, isDirectory: true,
path, path,
name: extractNameFromKey(path), name: extractNameFromKey(path),
child: { ...content[pathArr[pathArr.length - 1]], ...prevFiles.child } child: { ...content[pathArr[pathArr.length - 1]], ...(prevFiles ? prevFiles.child : {}) }
}) })
return files return files

Loading…
Cancel
Save