mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat(server): more e2e test cases
This commit is contained in:
24
packages/server/test/api-keys.e2e-spec.ts
Normal file
24
packages/server/test/api-keys.e2e-spec.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as request from 'supertest';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import { app, AuthorizationHeader, orgainzationId } from './init-app-test';
|
||||
|
||||
describe('API Keys (e2e)', () => {
|
||||
it('/api-keys (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/api-keys')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/api-keys/generate (POST)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.post('/api-keys/generate')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
name: faker.string.alphanumeric(10),
|
||||
})
|
||||
.expect(201);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user