mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix: e2e test cases
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
|
||||
import * as request from 'supertest';
|
||||
import { app } from './init-app-test';
|
||||
import { app, orgainzationId } from './init-app-test';
|
||||
|
||||
describe('Transactions Locking (e2e)', () => {
|
||||
it('/transactions-locking (PUT)', () => {
|
||||
describe.only('Transactions Locking (e2e)', () => {
|
||||
it('/transactions-locking/lock (PUT)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.put('/transactions-locking')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.put('/transactions-locking/lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
module: 'all',
|
||||
lock_to_date: '2025-01-01',
|
||||
@@ -14,4 +13,92 @@ describe('Transactions Locking (e2e)', () => {
|
||||
})
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
|
||||
it('/transactions-locking/cancel-lock (PUT)', async () => {
|
||||
await request(app.getHttpServer())
|
||||
.put('/transactions-locking/lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.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)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/transactions-locking/unlock-partial (PUT)', async () => {
|
||||
await request(app.getHttpServer())
|
||||
.put('/transactions-locking/lock')
|
||||
.set('organization-id', orgainzationId)
|
||||
.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)
|
||||
.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)
|
||||
.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)
|
||||
.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)
|
||||
.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)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/transactions-locking/:module (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/transactions-locking/all')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user