mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
fix: e2e test cases
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as request from 'supertest';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import { app } from './init-app-test';
|
||||
import { app, orgainzationId } from './init-app-test';
|
||||
|
||||
const requestBankRule = () => ({
|
||||
name: faker.company.name(),
|
||||
@@ -24,7 +24,7 @@ describe('Bank Rules (e2e)', () => {
|
||||
it('/banking/rules (POST)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.post('/banking/rules')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestBankRule())
|
||||
.expect(201);
|
||||
});
|
||||
@@ -32,14 +32,14 @@ describe('Bank Rules (e2e)', () => {
|
||||
it('/banking/rules/:id (PUT)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/banking/rules')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestBankRule());
|
||||
|
||||
const ruleId = response.body.id;
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put(`/banking/rules/${ruleId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestBankRule())
|
||||
.expect(200);
|
||||
});
|
||||
@@ -47,42 +47,42 @@ describe('Bank Rules (e2e)', () => {
|
||||
it('/banking/rules/:id (DELETE)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/banking/rules')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestBankRule());
|
||||
|
||||
const ruleId = response.body.id;
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.delete(`/banking/rules/${ruleId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/banking/rules/:id (GET)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/banking/rules')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestBankRule());
|
||||
|
||||
const ruleId = response.body.id;
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.get(`/banking/rules/${ruleId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/banking/rules (GET)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/banking/rules')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestBankRule());
|
||||
|
||||
const ruleId = response.body.id;
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.get(`/banking/rules/${ruleId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user