Skip to content

Commit

Permalink
test: ✅ test isBillable getBatches filter
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRill00 committed Feb 28, 2024
1 parent 64ec3ad commit 2d2ea37
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PrintOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export class PrintOne {
templates?: InFilter<string | Template>;
format?: InFilter;
status?: InFilter<BatchStatus>;
isBillable?: InFilter;
isBillable?: boolean;
};
} = {},
): Promise<PaginatedResponse<Batch>> {
Expand Down
22 changes: 22 additions & 0 deletions test/PrintOne.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,28 @@ describe("getBatches", function () {
expect(batch.billingId).toEqual("test");
});

it("should apply the isBillable filter", async function () {
// arrange

// act
const batches = await client.getBatches({
limit: 1,
filter: {
isBillable: true,
},
});
const batch = batches.data[0];

if (batch === undefined) {
console.warn("No orders found, skipping test");
return;
}

// assert
expect(batch).toBeDefined();
expect(batch.isBillable).toEqual(true);
});

it("should apply the name filter", async function () {
// arrange
const batchName = (await client.getBatches()).data[1]?.name ?? "test";
Expand Down

0 comments on commit 2d2ea37

Please sign in to comment.