Don't load example.com in /saveSnapshot
tests
This commit is contained in:
parent
fa143f1ea4
commit
46d0ce3cbf
1 changed files with 15 additions and 4 deletions
|
@ -4,6 +4,7 @@ describe("Connector Server", function () {
|
||||||
Components.utils.import("resource://zotero-unit/httpd.js");
|
Components.utils.import("resource://zotero-unit/httpd.js");
|
||||||
var win, connectorServerPath, testServerPath, httpd;
|
var win, connectorServerPath, testServerPath, httpd;
|
||||||
var testServerPort = 16213;
|
var testServerPort = 16213;
|
||||||
|
var snapshotHTML = "<html><head><title>Title</title><body>Body</body></html>";
|
||||||
|
|
||||||
before(function* () {
|
before(function* () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
@ -24,6 +25,16 @@ describe("Connector Server", function () {
|
||||||
testServerPath = 'http://127.0.0.1:' + testServerPort;
|
testServerPath = 'http://127.0.0.1:' + testServerPort;
|
||||||
httpd = new HttpServer();
|
httpd = new HttpServer();
|
||||||
httpd.start(testServerPort);
|
httpd.start(testServerPort);
|
||||||
|
|
||||||
|
httpd.registerPathHandler(
|
||||||
|
"/snapshot",
|
||||||
|
{
|
||||||
|
handle: function (request, response) {
|
||||||
|
response.setStatusLine(null, 200, "OK");
|
||||||
|
response.write(snapshotHTML);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function* () {
|
afterEach(function* () {
|
||||||
|
@ -1409,8 +1420,8 @@ describe("Connector Server", function () {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
url: "http://example.com",
|
url: testServerPath + '/snapshot',
|
||||||
html: "<html><head><title>Title</title><body>Body</body></html>"
|
html: snapshotHTML
|
||||||
}),
|
}),
|
||||||
successCodes: false
|
successCodes: false
|
||||||
}
|
}
|
||||||
|
@ -1645,7 +1656,7 @@ describe("Connector Server", function () {
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
sessionID,
|
sessionID,
|
||||||
url: "http://example.com",
|
url: testServerPath + '/snapshot',
|
||||||
html: "<html><head><title>Title</title><body>Body</body></html>"
|
html: "<html><head><title>Title</title><body>Body</body></html>"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1817,7 +1828,7 @@ describe("Connector Server", function () {
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
sessionID,
|
sessionID,
|
||||||
url: "http://example.com",
|
url: testServerPath + '/snapshot',
|
||||||
html: "<html><head><title>Title</title><body>Body</body></html>"
|
html: "<html><head><title>Title</title><body>Body</body></html>"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue