Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Commit e495ae4

Browse files
test: updated pricing table tests to create the UUID in the test itself
1 parent 8aae55e commit e495ae4

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/pricing-tables/v2/pricing-table-v2.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { testUuids } from '../../../test-utils/scripts/create-salable-test-data'
44
import { randomUUID } from 'crypto';
55
import { PricingTableSchema } from '../../schemas/v2/schemas-v2';
66

7-
const pricingTableUuid = randomUUID();
87
describe('Pricing Table V2 Tests', () => {
98
const apiKey = testUuids.devApiKeyV2;
109
const salable = initSalable(apiKey, 'v2');
10+
const pricingTableUuid = randomUUID();
1111

1212
beforeAll(async() => {
13-
await generateTestData()
13+
await generateTestData(pricingTableUuid)
1414
})
1515

1616
it('getAll: should successfully fetch all pricing tables', async () => {
@@ -20,7 +20,7 @@ describe('Pricing Table V2 Tests', () => {
2020
});
2121

2222

23-
const generateTestData = async () => {
23+
const generateTestData = async (pricingTableUuid: string) => {
2424

2525
const product = await prismaClient.product.findUnique({
2626
where: { uuid: testUuids.productUuid },

src/pricing-tables/v3/pricing-table-v3.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { PricingTableSchemaV3 } from '../../schemas/v3/schemas-v3';
44
import { initSalable } from '../../index';
55
import { randomUUID } from 'crypto';
66

7-
const pricingTableUuid = randomUUID();
87
describe('Pricing Table V3 Tests', () => {
98
const apiKey = testUuids.devApiKeyV3;
109
const salable = initSalable(apiKey, 'v3');
10+
const pricingTableUuid = randomUUID();
11+
1112
beforeAll(async() => {
12-
await generateTestData()
13+
await generateTestData(pricingTableUuid)
1314
})
1415

1516
it('getOne: should successfully fetch all pricing tables', async () => {
@@ -19,7 +20,7 @@ describe('Pricing Table V3 Tests', () => {
1920
});
2021

2122

22-
const generateTestData = async () => {
23+
const generateTestData = async (pricingTableUuid: string) => {
2324

2425
const product = await prismaClient.product.findUnique({
2526
where: { uuid: testUuids.productUuid },

0 commit comments

Comments
 (0)