From 2b0e20917d66ad21af372c5ed19f8f80da20ae71 Mon Sep 17 00:00:00 2001 From: UnderKoen Date: Thu, 9 May 2024 12:56:01 +0200 Subject: [PATCH] fix: batch status filter --- .github/workflows/test.yml | 7 ------- test/PrintOne.spec.ts | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16cd22c..8fa34ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,12 +1,5 @@ name: Test on: - push: - branches: - - main - - next - paths-ignore: - - "docs/**" - - "**/*.md" pull_request: paths-ignore: - "docs/**" diff --git a/test/PrintOne.spec.ts b/test/PrintOne.spec.ts index dcda7ef..e4927b5 100644 --- a/test/PrintOne.spec.ts +++ b/test/PrintOne.spec.ts @@ -1899,4 +1899,28 @@ describe("getBatches", function () { ]), ); }); + + it("should use the status filter (single)", async function () { + // arrange + + // act + const batches = await client.getBatches({ + limit: 1, + filter: { + status: [BatchStatus.batch_user_ready], + }, + }); + const batch = batches.data[0]; + + if (batch === undefined) { + console.warn("No batches found, skipping test"); + return; + } + + // assert + expect(batch).toBeDefined(); + expect(batch.status).toEqual( + expect.toBeOneOf([BatchStatus.batch_user_ready]), + ); + }); });