Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekono committed Jan 22, 2025
1 parent 22e83ff commit c6d25a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions tests/integration/customerGroups.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!);
});
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/disputes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
});
Expand All @@ -45,7 +45,7 @@ describe("Disputes API", () => {
evidenceText: "This is not a duplicate",
});
textEvidenceId = evidenceResponse.evidence!.id!;
}, 60_000);
}, 200_000);

afterAll(async () => {
// Clean up evidence if it exists
Expand Down

0 comments on commit c6d25a6

Please sign in to comment.