mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
refactor(nestjs): 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, orgainzationId } from './init-app-test';
|
||||
import { app, AuthorizationHeader, orgainzationId } from './init-app-test';
|
||||
|
||||
describe('Pdf Templates (e2e)', () => {
|
||||
it('/pdf-templates (POST)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.post('/pdf-templates')
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.send({
|
||||
template_name: 'Standard',
|
||||
resource: 'SaleInvoice',
|
||||
@@ -18,6 +18,7 @@ describe('Pdf Templates (e2e)', () => {
|
||||
it('/pdf-templates (DELETE)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/pdf-templates')
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
template_name: 'Standard',
|
||||
@@ -29,12 +30,14 @@ describe('Pdf Templates (e2e)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.delete(`/pdf-templates/${pdfTemplateId}`)
|
||||
.set('organization-id', orgainzationId)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/pdf-templates/:id (GET)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/pdf-templates')
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
template_name: 'Standard',
|
||||
@@ -45,6 +48,7 @@ describe('Pdf Templates (e2e)', () => {
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.get(`/pdf-templates/${pdfTemplateId}`)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
@@ -52,6 +56,7 @@ describe('Pdf Templates (e2e)', () => {
|
||||
it('/pdf-templates/:id/assign-default (POST)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/pdf-templates')
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
template_name: 'Standard',
|
||||
@@ -62,6 +67,7 @@ describe('Pdf Templates (e2e)', () => {
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put(`/pdf-templates/${pdfTemplateId}/assign-default`)
|
||||
.set('Authorization', AuthorizationHeader)
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user