pull/5370/head
yann300 5 months ago
parent d9e6adca2f
commit dddd5c183f
  1. 12
      apps/remix-ide-e2e/src/tests/url.test.ts
  2. 2
      libs/remix-url-resolver/src/github-folder-resolver.ts

@ -336,5 +336,17 @@ module.exports = {
.waitForElementVisible('*[data-shared="tooltipPopup"]')
.waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating fileManager and calling "open" ...')
.waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating terminal and calling "log" ...')
},
'Import Github folder from URL params #group4': function (browser: NightwatchBrowser) {
browser
.url('http://127.0.0.1:8080/#ghfolder=https://github.com/ethereum/remix-project/tree/master/apps/remix-ide/contracts/hardhat')
.refreshPage()
.currentWorkspaceIs('code-sample')
.openFile('contracts')
.openFile('Lock.sol')
.getEditorValue((content) => {
browser.assert.ok(content.indexOf('contract Lock {') !== -1, 'content does contain "contract Lock {"')
})
}
}

@ -9,7 +9,7 @@ export const githubFolderResolver = async (url, obj = {}, maxDepth, depth?, root
const pathname = urlObj.pathname;
const pathParts = pathname.split('/');
const folderPath = pathParts.slice(5).join('/');
rootPath = rootPath || folderPath
rootPath = rootPath || folderPath
for (const item of child) {
if (item.type === 'file') {
const response: AxiosResponse = await axios.get(item.download_url, { transformResponse: res => res })

Loading…
Cancel
Save