mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
113
packages/server/test/transactions-locking.e2e-spec.ts
Normal file
113
packages/server/test/transactions-locking.e2e-spec.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import * as request from 'supertest';
|
||||
import { app, AuthorizationHeader, orgainzationId } from './init-app-test';
|
||||
|
||||
describe.only('Transactions Locking (e2e)', () => {
|
||||
it('/transactions-locking/lock (PUT)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.put('/transactions-locking/lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
module: 'all',
|
||||
lock_to_date: '2025-01-01',
|
||||
reason: 'test',
|
||||
})
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/transactions-locking/cancel-lock (PUT)', async () => {
|
||||
await request(app.getHttpServer())
|
||||
.put('/transactions-locking/lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
module: 'all',
|
||||
lock_to_date: '2025-01-01',
|
||||
reason: 'test',
|
||||
})
|
||||
.expect(200);
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put('/transactions-locking/cancel-lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/transactions-locking/unlock-partial (PUT)', async () => {
|
||||
await request(app.getHttpServer())
|
||||
.put('/transactions-locking/lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
module: 'all',
|
||||
lock_to_date: '2025-01-01',
|
||||
reason: 'test',
|
||||
})
|
||||
.expect(200);
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put('/transactions-locking/cancel-lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
module: 'all',
|
||||
unlockFromDate: '2025-01-01',
|
||||
unlockToDate: '2025-12-31',
|
||||
reason: 'test partial unlock',
|
||||
})
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/transactions-locking/cancel-unlock-partial (PUT)', async () => {
|
||||
await request(app.getHttpServer())
|
||||
.put('/transactions-locking/lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
module: 'all',
|
||||
lock_to_date: '2025-01-01',
|
||||
reason: 'test',
|
||||
})
|
||||
.expect(200);
|
||||
|
||||
await request(app.getHttpServer())
|
||||
.put('/transactions-locking/unlock-partial')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
module: 'all',
|
||||
unlockFromDate: '2025-01-01',
|
||||
unlockToDate: '2025-12-31',
|
||||
reason: 'test partial unlock',
|
||||
})
|
||||
.expect(200);
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put('/transactions-locking/cancel-unlock-partial')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
module: 'all',
|
||||
unlockFromDate: '2025-01-01',
|
||||
unlockToDate: '2025-12-31',
|
||||
reason: 'test partial unlock',
|
||||
})
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/transactions-locking (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/transactions-locking')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/transactions-locking/:module (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/transactions-locking/all')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user