first commit
This commit is contained in:
23
myteamwallet_backend/test/admin/auth.e2e-spec.ts
Normal file
23
myteamwallet_backend/test/admin/auth.e2e-spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as request from 'supertest';
|
||||
import { ADMIN_EMAIL, ADMIN_PASSWORD, APP_URL } from '../utils/constants';
|
||||
|
||||
describe('Auth admin (e2e)', () => {
|
||||
const app = APP_URL;
|
||||
|
||||
it('Login: /api/v1/auth/admin/email/login (POST)', () => {
|
||||
return request(app)
|
||||
.post('/api/v1/auth/admin/email/login')
|
||||
.send({ email: ADMIN_EMAIL, password: ADMIN_PASSWORD })
|
||||
.expect(200)
|
||||
.expect(({ body }) => {
|
||||
expect(body.token).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
it('Login via user endpoint: /api/v1/auth/email/login (POST)', () => {
|
||||
return request(app)
|
||||
.post('/api/v1/auth/email/login')
|
||||
.send({ email: ADMIN_EMAIL, password: ADMIN_PASSWORD })
|
||||
.expect(422);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user