Skip to content

Commit 4ab9226

Browse files
authored
Merge pull request #17 from vizzuhq/veghdev
manual improvements
2 parents cf9182c + 8172fea commit 4ab9226

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

test/integration/manual/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ImgDiff from './imgdiff.js';
33
let queryString = window.location.search;
44
let urlParams = new URLSearchParams(queryString);
55
let urlTestCase = urlParams.get('testCase');
6+
let urlVersion = urlParams.get('version');
67

78
let vizzuUrl = document.getElementById('vizzuUrl');
89
let vizzuRefUrl = 'https://vizzu-lib-main.storage.googleapis.com/lib';
@@ -72,8 +73,11 @@ function populateLibs()
7273
let url = data[name];
7374
vizzuUrl.innerHTML += `<option value='${url}'>${name}</option>`;
7475
}
75-
let lastSelected = localStorage.getItem('vizzuUrl');
76-
if (lastSelected === '') lastSelected = data['localhost'];
76+
let lastSelected = localStorage.getItem('vizzuUrl');
77+
if (urlVersion) {
78+
lastSelected = data[urlVersion];
79+
}
80+
if (lastSelected === '') lastSelected = data['localhost'];
7781
vizzuUrl.value = lastSelected;
7882
populateCases();
7983
});

test/integration/manual/manual.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,27 @@ class Manual {
3737
this.#server.get('/getLibList', (req, res) => {
3838
let libList = { localhost: 'http://127.0.0.1:' + this.#port + '/example/lib' };
3939
libList['HEAD'] = 'https://' + remoteStableBucket + '/lib';
40+
this.#getLibJson().then(vizzuList => {
41+
vizzuList.slice().reverse().forEach(vizzu => {
42+
libList[vizzu.time.substring(0,10) + ' ' + vizzu.time.substring(11,16) + ' ' + vizzu.sha] = 'https://' + remoteLatestBucket + '/' + vizzu.sha;
43+
});
44+
//libList['0.3.1'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
45+
//libList['0.3.0'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
46+
libList['0.2.0'] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0';
47+
res.send(libList);
48+
});
49+
});
50+
}
51+
52+
#getLibJson() {
53+
return new Promise(resolve => {
4054
fetch('https://' + remoteCloudFunctions + '/getVizzuList').then(vizzuListUrl => {
4155
vizzuListUrl.json().then(vizzuList => {
42-
vizzuList.slice().reverse().forEach(vizzu => {
43-
libList[vizzu.time.substring(0,10) + ' ' + vizzu.time.substring(11,16) + ' ' + vizzu.sha] = 'https://' + remoteLatestBucket + '/' + vizzu.sha;
44-
});
45-
//libList['0.3.1'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
46-
//libList['0.3.0'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
47-
libList['0.2.0'] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0';
48-
res.send(libList);
49-
}).catch((err) => {
50-
console.log(err)
56+
resolve(vizzuList);
57+
}).catch((err) => {
58+
resolve(this.#getLibJson())
5159
});
52-
});
60+
});
5361
});
5462
}
5563

test/integration/vizzutest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ try {
231231
console.error(('tests failed:'.padEnd(15, ' ') + this.#testSuiteResults.FAILED.length).error);
232232
process.exitCode = 1;
233233
this.#testSuiteResults.FAILED.forEach(testCase => {
234-
console.error(''.padEnd(padLength + 5, ' ') + testCase);
234+
console.error(''.padEnd(padLength + 5, ' ') + testCase + ' http://127.0.0.1:8080/test/integration/manual/?version=localhost&testCase=' + testCase);
235235
});
236236
} else {
237237
console.log('tests failed:'.padEnd(15, ' ') + this.#testSuiteResults.FAILED.length);

0 commit comments

Comments
 (0)