mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
test missing files and missing jsonp callbacks, currently failing
This commit is contained in:
parent
b1aced32a9
commit
8795c58235
1 changed files with 48 additions and 0 deletions
|
@ -129,6 +129,30 @@ describe(__filename, function () {
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should 200 for unknown resources with jsonp callback', async function() {
|
||||||
|
const missingResource = '/javascripts/lib/ep_etherpad-lite/static/js/ace2_inner2.js?callback=require.define';
|
||||||
|
const expectedResource = "require.define({\n \"ep_etherpad-lite/static/js/ace2_inner2.js\": null\n});\n";
|
||||||
|
await agent.get(missingResource)
|
||||||
|
.then((res) => {
|
||||||
|
assert.equal(expectedResource, res.text);
|
||||||
|
assert.equal(res.statusCode, 200);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO should probably be 404
|
||||||
|
it('should 502 for unknown and known resources without jsonp callback', async function() {
|
||||||
|
const missingCallbackUnknownFile = '/javascripts/lib/ep_etherpad-lite/static/js/ace2_inner2.js';
|
||||||
|
const missingCallbackKnownFile = '/javascripts/lib/ep_etherpad-lite/static/js/ace2_inner.js';
|
||||||
|
await agent.get(missingCallbackUnknownFile)
|
||||||
|
.then((res) => {
|
||||||
|
assert.equal(res.statusCode, 502);
|
||||||
|
});
|
||||||
|
await agent.get(missingCallbackKnownFile)
|
||||||
|
.then((res) => {
|
||||||
|
assert.equal(res.statusCode, 502);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
context('expiration', function(){
|
context('expiration', function(){
|
||||||
it('has date, last-modified and expires header', async function() {
|
it('has date, last-modified and expires header', async function() {
|
||||||
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
||||||
|
@ -238,6 +262,30 @@ describe(__filename, function () {
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should 200 for unknown resources with jsonp callback', async function() {
|
||||||
|
const missingResource = '/javascripts/lib/ep_etherpad-lite/static/js/ace2_inner2.js?callback=require.define';
|
||||||
|
const expectedResource = "require.define({\n \"ep_etherpad-lite/static/js/ace2_inner2.js\": null\n});\n";
|
||||||
|
await agent.get(missingResource)
|
||||||
|
.then((res) => {
|
||||||
|
assert.equal(expectedResource, res.text);
|
||||||
|
assert.equal(res.statusCode, 200);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO should probably be 404
|
||||||
|
it('should 502 for unknown and known resources without jsonp callback', async function() {
|
||||||
|
const missingCallbackUnknownFile = '/javascripts/lib/ep_etherpad-lite/static/js/ace2_inner2.js';
|
||||||
|
const missingCallbackKnownFile = '/javascripts/lib/ep_etherpad-lite/static/js/ace2_inner.js';
|
||||||
|
await agent.get(missingCallbackUnknownFile)
|
||||||
|
.then((res) => {
|
||||||
|
assert.equal(res.statusCode, 502);
|
||||||
|
});
|
||||||
|
await agent.get(missingCallbackKnownFile)
|
||||||
|
.then((res) => {
|
||||||
|
assert.equal(res.statusCode, 502);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
context('expiration', function(){
|
context('expiration', function(){
|
||||||
it('has date, last-modified and expires header', async function() {
|
it('has date, last-modified and expires header', async function() {
|
||||||
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
await Promise.all(packages.map(async (resource) => await agent.get(resource)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue