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';
|
||
2 years ago
|
import User from '../../../src/lib/models/User';
|
||
2 years ago
|
|
||
2 years ago
|
const defaultUserArgs = {
|
||
|
email: 'test@example.com',
|
||
|
password: 'A1234abh2@dsad',
|
||
|
};
|
||
|
|
||
2 years ago
|
const createUser = async (context, userArgs = {}) => {
|
||
2 years ago
|
const args = { ...defaultUserArgs, ...userArgs };
|
||
2 years ago
|
const response = await request(context.app)
|
||
2 years ago
|
.post('/api/v1/auth/user/signup')
|
||
2 years ago
|
.send(args);
|
||
|
const user = User.getByEmail(args.email);
|
||
2 years ago
|
return { token: response.body.token, user };
|
||
2 years ago
|
};
|
||
|
|
||
2 years ago
|
export { createUser, defaultUserArgs };
|