mirror of
https://github.com/strapi/strapi.git
synced 2025-12-24 21:54:24 +00:00
fix token builder
This commit is contained in:
parent
8ca7c13449
commit
f97c59ff90
@ -34,17 +34,17 @@ describe('Admin API Token v2 CRUD (e2e)', () => {
|
||||
// create a random valid token that we can test with (delete, list, etc)
|
||||
let currentTokens = 0;
|
||||
const createValidToken = async (token = {}) => {
|
||||
const body = {
|
||||
type: 'read-only',
|
||||
name: 'token_' + String(currentTokens++),
|
||||
description: 'generic description',
|
||||
...token,
|
||||
};
|
||||
|
||||
const req = await rq({
|
||||
url: '/admin/api-tokens',
|
||||
method: 'POST',
|
||||
body: Object.assign(
|
||||
{
|
||||
type: 'read-only',
|
||||
name: 'token_' + String(currentTokens++),
|
||||
description: 'generic description',
|
||||
},
|
||||
token
|
||||
),
|
||||
body,
|
||||
});
|
||||
|
||||
expect(req.status).toEqual(201);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user