diff --git a/tests/integration/customerGroups.test.ts b/tests/integration/customerGroups.test.ts index 9612440cc..14c14be88 100644 --- a/tests/integration/customerGroups.test.ts +++ b/tests/integration/customerGroups.test.ts @@ -17,19 +17,19 @@ function deleteTestCustomerGroup(client: SquareClient, groupId: string): Promise describe("CustomerGroups API", () => { const client = createClient(); - it("should list customer groups", async () => { - const response = await client.customers.groups.list(); - - expect(response.data).toBeDefined(); - expect(response.data.length).toBeGreaterThan(0); - }); - - it("should create a customer group", async () => { + it("should create and list a customer group", async () => { + // create const response = await createTestCustomerGroup(client); expect(response.group).toBeDefined(); expect(response.group?.name).toBeDefined(); + // list + const listResponse = await client.customers.groups.list(); + + expect(listResponse.data).toBeDefined(); + expect(listResponse.data.length).toBeGreaterThan(0); + // Cleanup await deleteTestCustomerGroup(client, response.group?.id!); }); diff --git a/tests/integration/disputes.test.ts b/tests/integration/disputes.test.ts index 1554becce..ed0de54d8 100644 --- a/tests/integration/disputes.test.ts +++ b/tests/integration/disputes.test.ts @@ -8,7 +8,7 @@ describe("Disputes API", () => { beforeAll(async () => { // Create a payment that will generate a dispute - await client.payments.create({ + const paymentsResp = await client.payments.create({ idempotencyKey: newTestUuid(), autocomplete: true, sourceId: "cnon:card-nonce-ok", @@ -19,7 +19,7 @@ describe("Disputes API", () => { }); // Poll for dispute to be created - for (let i = 0; i < 20; i++) { + for (let i = 0; i < 100; i++) { const disputeResponse = await client.disputes.list({ states: "EVIDENCE_REQUIRED", });