From 13189514ff8214b87e692e9f9b5eb9418a217d17 Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 13 Apr 2022 00:41:01 +0800 Subject: [PATCH] fix: users:check --- packages/plugin-users/src/__tests__/actions.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/plugin-users/src/__tests__/actions.test.ts b/packages/plugin-users/src/__tests__/actions.test.ts index 9b37c6605..56cbd660f 100644 --- a/packages/plugin-users/src/__tests__/actions.test.ts +++ b/packages/plugin-users/src/__tests__/actions.test.ts @@ -1,8 +1,8 @@ -import { mockServer, MockServer } from '@nocobase/test'; import Database from '@nocobase/database'; import PluginACL from '@nocobase/plugin-acl'; -import PluginUsers from '../server'; +import { mockServer, MockServer } from '@nocobase/test'; import supertest from 'supertest'; +import PluginUsers from '../server'; import { userPluginConfig } from './utils'; describe('actions', () => { @@ -32,7 +32,7 @@ describe('actions', () => { const { adminEmail, adminPassword } = userPluginConfig.installing; 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({ email: adminEmail, @@ -46,6 +46,6 @@ describe('actions', () => { expect(token).toBeDefined(); response = await agent.get('/users:check').set({ Authorization: 'Bearer ' + token }); - expect(response.statusCode).toEqual(200); + expect(response.body.data.id).toBeDefined(); }); });