Skip to content

Commit c6d25a6

Browse files
committed
update tests
1 parent 22e83ff commit c6d25a6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/integration/customerGroups.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ function deleteTestCustomerGroup(client: SquareClient, groupId: string): Promise
1717
describe("CustomerGroups API", () => {
1818
const client = createClient();
1919

20-
it("should list customer groups", async () => {
21-
const response = await client.customers.groups.list();
22-
23-
expect(response.data).toBeDefined();
24-
expect(response.data.length).toBeGreaterThan(0);
25-
});
26-
27-
it("should create a customer group", async () => {
20+
it("should create and list a customer group", async () => {
21+
// create
2822
const response = await createTestCustomerGroup(client);
2923

3024
expect(response.group).toBeDefined();
3125
expect(response.group?.name).toBeDefined();
3226

27+
// list
28+
const listResponse = await client.customers.groups.list();
29+
30+
expect(listResponse.data).toBeDefined();
31+
expect(listResponse.data.length).toBeGreaterThan(0);
32+
3333
// Cleanup
3434
await deleteTestCustomerGroup(client, response.group?.id!);
3535
});

tests/integration/disputes.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe("Disputes API", () => {
88

99
beforeAll(async () => {
1010
// Create a payment that will generate a dispute
11-
await client.payments.create({
11+
const paymentsResp = await client.payments.create({
1212
idempotencyKey: newTestUuid(),
1313
autocomplete: true,
1414
sourceId: "cnon:card-nonce-ok",
@@ -19,7 +19,7 @@ describe("Disputes API", () => {
1919
});
2020

2121
// Poll for dispute to be created
22-
for (let i = 0; i < 20; i++) {
22+
for (let i = 0; i < 100; i++) {
2323
const disputeResponse = await client.disputes.list({
2424
states: "EVIDENCE_REQUIRED",
2525
});
@@ -45,7 +45,7 @@ describe("Disputes API", () => {
4545
evidenceText: "This is not a duplicate",
4646
});
4747
textEvidenceId = evidenceResponse.evidence!.id!;
48-
}, 60_000);
48+
}, 200_000);
4949

5050
afterAll(async () => {
5151
// Clean up evidence if it exists

0 commit comments

Comments
 (0)