Skip to content

Commit c58e72a

Browse files
authored
Merge pull request #261 from veghdev/integrationtest_offline
Allows to run integration test offline
2 parents 95e4b68 + 8a52742 commit c58e72a

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

test/integration/modules/integration-test/test-case/test-case-result.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class TestCaseResult {
120120
} else {
121121
if (
122122
this.#testCaseObj.createImages !== "DISABLED" &&
123-
this.#vizzuUrl !== this.#vizzuRefUrl
123+
this.#vizzuRefUrl && this.#vizzuUrl !== this.#vizzuRefUrl
124124
) {
125125
let testCaseObj = Object.assign({}, this.#testCaseObj);
126126
testCaseObj.createImages = "ALL";

test/integration/modules/integration-test/test-suite.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,17 @@ class TestSuite {
243243
);
244244
});
245245

246-
this.#vizzuRefUrlReady = VizzuUrl.resolveVizzuUrl(
247-
this.#vizzuRefUrl,
248-
TestEnv.getWorkspacePath(),
249-
TestEnv.getTestSuitePath()
250-
);
246+
this.#vizzuRefUrlReady = new Promise(resolve => {
247+
return VizzuUrl.resolveVizzuUrl(
248+
this.#vizzuRefUrl,
249+
TestEnv.getWorkspacePath(),
250+
TestEnv.getTestSuitePath()
251+
).then((url) => {
252+
return resolve(url);
253+
}).catch(() => {
254+
return resolve("");
255+
})
256+
});
251257
startTestSuiteReady.push(this.#vizzuRefUrlReady);
252258
this.#vizzuRefUrlReady.then((url) => {
253259
this.#vizzuRefUrl = url;

test/integration/modules/vizzu/vizzu-url.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class VizzuUrl {
111111
return resolve(url);
112112
}
113113
return reject(response.status);
114+
}).catch((err) => {
115+
return reject(err);
114116
});
115117
});
116118
}

test/integration/test_cases/web_content/cookbook/chart_types/map.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ const testSteps = [
44
async chart =>
55
{
66
function urlToImage(url) {
7-
return new Promise(resolve => {
8-
const image = new Image();
9-
image.addEventListener('load', () => { resolve(image); });
10-
image.src = url;
7+
return new Promise((resolve, reject) => {
8+
const image = new Image();
9+
image.addEventListener('load', () => {
10+
resolve(image);
11+
});
12+
image.addEventListener('error', () => {
13+
reject(new Error('Failed to load image: ' + url));
14+
});
15+
image.src = url;
1116
});
1217
}
1318

0 commit comments

Comments
 (0)