breaking: remove socket.io/flags.js

refactor: helpers.loginUser returns a single object {jar, csrf_token}
This commit is contained in:
Barış Soner Uşaklı
2021-11-22 19:23:51 -05:00
parent f0d192fbfd
commit c5f08fdc81
16 changed files with 175 additions and 300 deletions

View File

@@ -208,7 +208,7 @@ describe('API', async () => {
});
// All tests run as admin user
jar = await helpers.loginUser('admin', '123456');
({ jar } = await helpers.loginUser('admin', '123456'));
// Retrieve CSRF token using cookie, to test Write API
const config = await request({
@@ -457,7 +457,7 @@ describe('API', async () => {
it('should successfully re-login if needed', async () => {
const reloginPaths = ['PUT /users/{uid}/password', 'DELETE /users/{uid}/sessions/{uuid}'];
if (reloginPaths.includes(`${method.toUpperCase()} ${path}`)) {
jar = await helpers.loginUser('admin', '123456');
({ jar } = await helpers.loginUser('admin', '123456'));
const sessionUUIDs = await db.getObject('uid:1:sessionUUID:sessionId');
mocks.delete['/users/{uid}/sessions/{uuid}'][1].example = Object.keys(sessionUUIDs).pop();