diff --git a/apps/remix-ide-e2e/src/tests/homeTab.test.ts b/apps/remix-ide-e2e/src/tests/homeTab.test.ts new file mode 100644 index 0000000000..81f78be22a --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/homeTab.test.ts @@ -0,0 +1,20 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +module.exports = { + + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done) + }, + + 'Should create new file': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="homeTabNewFile"]') + .click('*[data-id="homeTabNewFile"]') + .waitForElementContainsText('*[data-id$="/blank"]', '', 60000) + .sendKeys('*[data-id$="/blank"] .remixui_items', 'newTestFile') + .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemnewTestFile.sol"]') + } +} \ No newline at end of file diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index 71c637406b..d6a3708269 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -102,10 +102,7 @@ module.exports = class Filepanel extends ViewPlugin { createNewFile () { return new Promise((resolve, reject) => { - const provider = this.fileManager.currentFileProvider() - const dir = provider.workspace || '/' - - this.emit('createNewFileInputReducerEvent', dir, (err, data) => { + this.emit('createNewFileInputReducerEvent', '/', (err, data) => { if (err) reject(err) else resolve(data) }) @@ -114,10 +111,7 @@ module.exports = class Filepanel extends ViewPlugin { uploadFile (target) { return new Promise((resolve, reject) => { - const provider = this.fileManager.currentFileProvider() - const dir = provider.workspace || '/' - - return this.emit('uploadFileReducerEvent', dir, target, (err, data) => { + return this.emit('uploadFileReducerEvent', '/', target, (err, data) => { if (err) reject(err) else resolve(data) }) diff --git a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx index 07120d63dc..2914b9ee69 100644 --- a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx +++ b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx @@ -273,7 +273,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {

File

- +