mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-04-19 08:27:40 +00:00
fixed more repo= qs stuff
This commit is contained in:
+2
-1
@@ -2383,8 +2383,9 @@ export function getPlatformAndRepo() {
|
||||
var repo = getRepos()[repo_id];
|
||||
// override query string params w/ repo settings
|
||||
if (repo) {
|
||||
console.log(platform_id, qs, repo);
|
||||
qs.repo = repo_id;
|
||||
if (repo.platform_id)
|
||||
if (repo.platform_id && !qs.platform)
|
||||
qs.platform = platform_id = repo.platform_id;
|
||||
if (!qs.file && repo.mainPath)
|
||||
qs.file = repo.mainPath;
|
||||
|
||||
+12
-4
@@ -9,8 +9,8 @@ var FILE = 'happy2020.c'
|
||||
var PRESETFILE = 'hello.c'
|
||||
var QS_GITHUBURL = '&githubURL=https%3A%2F%2Fgithub.com%2F' + REPO
|
||||
|
||||
let github_config = JSON.parse(require('fs').readFileSync('./github.json','utf-8'));
|
||||
if (github_config?.token) {
|
||||
try {
|
||||
var github_config = JSON.parse(require('fs').readFileSync('./github.json','utf-8'));
|
||||
exports['beforeEach'] = function(browser) {
|
||||
browser.setCookie({
|
||||
name: '__github_key',
|
||||
@@ -18,8 +18,8 @@ if (github_config?.token) {
|
||||
path: '/'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
throw new Error('need ./github.js with {token:"..."}')
|
||||
} catch (e) {
|
||||
console.log('warning: need ./github.json with {token:"..."}')
|
||||
}
|
||||
|
||||
exports['test import Github'] = async function (browser) {
|
||||
@@ -63,6 +63,14 @@ exports['test import Github'] = async function (browser) {
|
||||
browser.expect.url().to.contain(`file=${FILE}`)
|
||||
browser.expect.url().to.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||
|
||||
await browser.url(`${IDEURL}?platform=apple2`)
|
||||
.waitForElementNotVisible('#error_alert')
|
||||
.waitForElementVisible('#emuscreen')
|
||||
.waitForElementVisible('.emuvideo')
|
||||
|
||||
browser.expect.url().to.contain(`platform=apple2`)
|
||||
browser.expect.url().to.not.contain(`repo=${REPO.replace('/', '%2F')}`)
|
||||
|
||||
await browser.url(`${IDEURL}?platform=${PLATFORM}&file=${PRESETFILE}`)
|
||||
.waitForElementNotVisible('#error_alert')
|
||||
.waitForElementVisible('#emuscreen')
|
||||
|
||||
Reference in New Issue
Block a user