mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
515 B
19 lines
515 B
2 years ago
|
import request from 'supertest';
|
||
|
import { User } from '../../../src/models'
|
||
|
|
||
|
const defaultUserArgs = {
|
||
|
email: 'test@example.com',
|
||
|
password: 'A1234abh2@dsad',
|
||
|
};
|
||
|
|
||
|
const createUser = async (context, userArgs = {}) => {
|
||
|
const args = { ...defaultUserArgs, ...userArgs };
|
||
|
const response = await request(context.app)
|
||
|
.post('/api/v1/auth/user/signup')
|
||
|
.send(args);
|
||
|
const user = await User.getByEmail(args.email);
|
||
|
return { token: response.body.token, user };
|
||
|
};
|
||
|
|
||
|
export { createUser, defaultUserArgs };
|