From 799a12937d873aba46085c2f571b00c0884c8a60 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Fri, 5 Nov 2021 10:16:45 +0100 Subject: [PATCH] terminal tests --- apps/remix-ide-e2e/src/helpers/init.ts | 2 +- apps/remix-ide-e2e/src/tests/terminal.test.ts | 2 +- apps/remix-ide/src/app/ui/landing-page/landing-page.js | 2 ++ libs/remix-ui/workspace/src/lib/reducers/workspace.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/helpers/init.ts b/apps/remix-ide-e2e/src/helpers/init.ts index ba6266be54..093014de9d 100644 --- a/apps/remix-ide-e2e/src/helpers/init.ts +++ b/apps/remix-ide-e2e/src/helpers/init.ts @@ -4,7 +4,7 @@ require('dotenv').config() export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true): void { browser - .url(url || 'http://127.0.0.1:8080') + .url(url || 'http://localhost:8080') .pause(5000) .switchBrowserTab(0) .waitForElementVisible('[id="remixTourSkipbtn"]') diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 08eb4ed91e..1b9f3feed3 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -4,7 +4,7 @@ import init from '../helpers/init' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false) + init(browser, done, 'http://localhost:8080?plugins=solidity,udapp', false) }, 'Should execution a simple console command': function (browser: NightwatchBrowser) { diff --git a/apps/remix-ide/src/app/ui/landing-page/landing-page.js b/apps/remix-ide/src/app/ui/landing-page/landing-page.js index feae5c3554..368ac97c5d 100644 --- a/apps/remix-ide/src/app/ui/landing-page/landing-page.js +++ b/apps/remix-ide/src/app/ui/landing-page/landing-page.js @@ -423,6 +423,8 @@ export class LandingPage extends ViewPlugin { } } const setDemoFile = async () => { + await this.call('filePanel', 'createWorkspace', `workspace_${Date.now()}`, true) + await this.call('fileManager', 'setFile', 'tests/one/two/three/four/file.js','neihjiehjiheiheihiehiehiheiheihi') } const onAcceptDownloadn = async () => { diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index d180efba5c..fa156c691b 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -656,7 +656,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s let prevFiles = _.get(files, _path) if (!prevFiles) { - var object = {}; var o = object + const object = {}; let o = object for (const pa of _path) { o = o[pa] = {} }