refactor: tax rates to nestjs

This commit is contained in:
Ahmed Bouhuolia
2024-12-20 12:24:50 +02:00
parent 1f32a7c59a
commit 330192c042
29 changed files with 1631 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import * as request from 'supertest';
import { faker } from '@faker-js/faker';
import { app } from './init-app-test';
describe('Item Categories(e2e)', () => {
it('/tax-rates (POST)', () => {
return request(app.getHttpServer())
.post('/tax-rates')
.set('organization-id', '4064541lv40nhca')
.send({
name: faker.person.fullName(),
rate: 2,
code: faker.string.uuid(),
active: 1,
})
.expect(201);
});
it('/tax-rates/:id (DELETE)', async () => {
const response = await request(app.getHttpServer())
.post('/tax-rates')
.set('organization-id', '4064541lv40nhca')
.send({
name: faker.person.fullName(),
rate: 2,
code: faker.string.uuid(),
active: 1,
});
const taxRateId = response.body.id;
return request(app.getHttpServer())
.delete(`/tax-rates/${taxRateId}`)
.set('organization-id', '4064541lv40nhca')
.expect(200);
});
});