fix: users:check
This commit is contained in:
parent
4c2df15da2
commit
13189514ff
@ -1,8 +1,8 @@
|
|||||||
import { mockServer, MockServer } from '@nocobase/test';
|
|
||||||
import Database from '@nocobase/database';
|
import Database from '@nocobase/database';
|
||||||
import PluginACL from '@nocobase/plugin-acl';
|
import PluginACL from '@nocobase/plugin-acl';
|
||||||
import PluginUsers from '../server';
|
import { mockServer, MockServer } from '@nocobase/test';
|
||||||
import supertest from 'supertest';
|
import supertest from 'supertest';
|
||||||
|
import PluginUsers from '../server';
|
||||||
import { userPluginConfig } from './utils';
|
import { userPluginConfig } from './utils';
|
||||||
|
|
||||||
describe('actions', () => {
|
describe('actions', () => {
|
||||||
@ -32,7 +32,7 @@ describe('actions', () => {
|
|||||||
const { adminEmail, adminPassword } = userPluginConfig.installing;
|
const { adminEmail, adminPassword } = userPluginConfig.installing;
|
||||||
|
|
||||||
let response = await api.agent().resource('users').check();
|
let response = await api.agent().resource('users').check();
|
||||||
expect(response.statusCode).toEqual(401);
|
expect(response.body.data.id).toBeUndefined();
|
||||||
|
|
||||||
response = await agent.post('/users:signin').send({
|
response = await agent.post('/users:signin').send({
|
||||||
email: adminEmail,
|
email: adminEmail,
|
||||||
@ -46,6 +46,6 @@ describe('actions', () => {
|
|||||||
expect(token).toBeDefined();
|
expect(token).toBeDefined();
|
||||||
|
|
||||||
response = await agent.get('/users:check').set({ Authorization: 'Bearer ' + token });
|
response = await agent.get('/users:check').set({ Authorization: 'Bearer ' + token });
|
||||||
expect(response.statusCode).toEqual(200);
|
expect(response.body.data.id).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user