mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
session: check session_id is present in response
This commit is contained in:
parent
d7fe2afad9
commit
4904e7f486
1 changed files with 10 additions and 3 deletions
|
@ -25,13 +25,16 @@ describe(__filename, function () {
|
||||||
if (settings.dbType !== 'dirty') this.skip;
|
if (settings.dbType !== 'dirty') this.skip;
|
||||||
|
|
||||||
this.timeout(100);
|
this.timeout(100);
|
||||||
|
|
||||||
for (const endpoint of shouldNotCreateExpressSession) {
|
for (const endpoint of shouldNotCreateExpressSession) {
|
||||||
it(endpoint, async function () {
|
it(endpoint, async function () {
|
||||||
const previousCount = store.length();
|
const previousCount = store.length();
|
||||||
await agent.get(endpoint)
|
await agent.get(endpoint)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect(() => {
|
.expect((res) => {
|
||||||
|
const hasExpressSessionCookie =
|
||||||
|
res.headers['set-cookie'][0].indexOf('express_sid');
|
||||||
|
assert(hasExpressSessionCookie === -1);
|
||||||
|
console.error(res);
|
||||||
const newCount = store.length();
|
const newCount = store.length();
|
||||||
assert(newCount === previousCount);
|
assert(newCount === previousCount);
|
||||||
})
|
})
|
||||||
|
@ -48,7 +51,11 @@ describe(__filename, function () {
|
||||||
it(endpoint, async function () {
|
it(endpoint, async function () {
|
||||||
await agent.get(endpoint)
|
await agent.get(endpoint)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect(() => {
|
.expect((res) => {
|
||||||
|
console.error(res.headers['set-cookie']);
|
||||||
|
const hasExpressSessionCookie =
|
||||||
|
res.headers['set-cookie'][0].indexOf('express_sid');
|
||||||
|
assert(hasExpressSessionCookie !== -1);
|
||||||
const newCount = store.length();
|
const newCount = store.length();
|
||||||
console.log(newCount);
|
console.log(newCount);
|
||||||
assert(newCount > previousCount);
|
assert(newCount > previousCount);
|
||||||
|
|
Loading…
Reference in a new issue