mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
fix: e2e test cases
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import * as request from 'supertest';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import { app } from './init-app-test';
|
||||
import { app, orgainzationId } from './init-app-test';
|
||||
|
||||
describe('Branches (e2e)', () => {
|
||||
it('/branches (POST)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.post('/branches')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
name: faker.commerce.productName(),
|
||||
code: faker.string.alpha(4),
|
||||
@@ -17,7 +17,7 @@ describe('Branches (e2e)', () => {
|
||||
it('/branches/:id (DELETE)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/branches')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
name: faker.commerce.productName(),
|
||||
code: faker.string.alpha(4),
|
||||
@@ -26,14 +26,14 @@ describe('Branches (e2e)', () => {
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.delete(`/branches/${branchId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/branches/:id (PUT)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/branches')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
name: faker.commerce.productName(),
|
||||
code: faker.string.alpha(4),
|
||||
@@ -42,14 +42,14 @@ describe('Branches (e2e)', () => {
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put(`/branches/${branchId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/branches/:id (GET)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/branches')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
name: faker.commerce.productName(),
|
||||
code: faker.string.alpha(4),
|
||||
@@ -58,14 +58,14 @@ describe('Branches (e2e)', () => {
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.get(`/branches/${branchId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/branches (GET)', async () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/branches')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user