New version yo

This commit is contained in:
2023-05-10 22:35:38 +02:00
parent 61590f684e
commit b880f2f48b
21 changed files with 42 additions and 37 deletions

View File

@@ -6,7 +6,7 @@ import setConfig from '../test-helpers/config.js';
test('test-cases/00start.js: Wait for auth API to be ready', async t => {
setConfig({ printConfig: true });
const backendHealthCheck = await got(process.env.AUTH_URL, { retry: 2000 });
const backendHealthCheck = await got(process.env.AUTH_URL, { retry: { limit: 2000 }});
t.equal(backendHealthCheck.statusCode, 200, 'Auth API should answer with status code 200');
});

View File

@@ -54,7 +54,7 @@ test('test-cases/01basic.js: GETting the admin account, with the token we just o
});
test('test-cases/01basic.js: Creating a new account', async t => {
const res = await got.post(`${process.env.AUTH_URL}/account`, {
const res = await got.post(`${process.env.AUTH_URL}/accounts`, {
headers: { 'Authorization': `bearer ${adminJWTString}`},
json: {
fields: [
@@ -79,7 +79,7 @@ test('test-cases/01basic.js: Creating a new account', async t => {
t.notEqual(user.apiKey, undefined, 'The new account should have an apiKey');
try {
await got.post(`${process.env.AUTH_URL}/account`, {
await got.post(`${process.env.AUTH_URL}/accounts`, {
headers: { 'Authorization': `bearer ${adminJWTString}`},
json: {
fields: [{name: 'role',values: ['user'],}],
@@ -187,7 +187,7 @@ test('test-cases/01basic.js: Remove an account', async t => {
await got.delete(`${process.env.AUTH_URL}/accounts/a423e690-74b9-4f37-9976-f5bf75a5ea32`, {
headers: { 'Authorization': `bearer ${adminJWTString}`},
responseType: 'json',
retry: 0,
retry: { limit: 0 },
});
t.fail('Response status for DELETing an account that does not exist should be 404');
} catch (err) {
@@ -197,7 +197,7 @@ test('test-cases/01basic.js: Remove an account', async t => {
const delRes = await got.delete(`${process.env.AUTH_URL}/accounts/${user.id}`, {
headers: { 'Authorization': `bearer ${adminJWTString}`},
responseType: 'json',
retry: 0,
retry: { limit: 0 },
});
t.equal(delRes.statusCode, 204, 'Response status for DELETE should be 204');
@@ -206,7 +206,7 @@ test('test-cases/01basic.js: Remove an account', async t => {
await got(`${process.env.AUTH_URL}/accounts/${user.id}`, {
headers: { 'Authorization': `bearer ${adminJWTString}`},
responseType: 'json',
retry: 0,
retry: { limit: 0 },
});
t.fail('Response status for GETing the account again should be 404');
} catch (err) {