Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { settleAttendeeBalance } from "#shared/db/attendees/balance.ts";
import { balanceFinalizeStatements } from "#shared/db/payment-finalize.ts";
import { reserveSession } from "#shared/db/processed-payments.ts";
import type { Attendee, Listing } from "#shared/types.ts";
import type { RefundCtx } from "#test/lib/server-refunds-helpers.ts";
import {
expectFlashRedirect,
expectHtmlResponse,
Expand All @@ -23,7 +24,6 @@ import {
withRefundMock,
} from "#test-utils/refund-routes.ts";
import { adminGet, testCookie, testCsrfToken } from "#test-utils/session.ts";
import type { RefundCtx } from "./server-refunds-helpers.ts";

const SETTLED_RESERVATION_REFERENCES = [
"pi_reservation_balance",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { afterEach, beforeEach, describe, it as test } from "@std/testing/bdd";
import { handleRequest } from "#routes";
import { setN1GuardNotifyOnly } from "#shared/db/query-log.ts";
import { BULK_REFUND_LIMIT } from "#shared/subrequest-budget.ts";
import {
createPaidListing,
expectPartialRefund,
seedBatchAttendees,
setupRefundTest,
} from "#test/lib/server-refunds-helpers.ts";
import { getListingActivityLog } from "#test-utils/activity-log.ts";
import {
expectFlash,
Expand All @@ -25,12 +31,6 @@ import {
withRefundMock,
} from "#test-utils/refund-routes.ts";
import { testCookie, testCsrfToken } from "#test-utils/session.ts";
import {
createPaidListing,
expectPartialRefund,
seedBatchAttendees,
setupRefundTest,
} from "./server-refunds-helpers.ts";

describeWithEnv("server (admin refund-all)", { db: true }, () => {
describe("GET /admin/listing/:id/refund-all", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { expect } from "@std/expect";
import { describe, it as test } from "@std/testing/bdd";
import {
createPaidListing,
setupRefundTest,
} from "#test/lib/server-refunds-helpers.ts";
import { describeWithEnv } from "#test-utils/db.ts";
import { createPaidTestAttendee } from "#test-utils/db-helpers/attendee-payments.ts";
import { setupErrorSpy } from "#test-utils/error-spy.ts";
Expand All @@ -8,10 +12,6 @@ import {
submitRefund,
withRefundMock,
} from "#test-utils/refund-routes.ts";
import {
createPaidListing,
setupRefundTest,
} from "./server-refunds-helpers.ts";

describeWithEnv("server (admin refund provider logging)", { db: true }, () => {
describe("provider refund failures reach the error log", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { expect } from "@std/expect";
import { describe, it as test } from "@std/testing/bdd";
import { handleRequest } from "#routes";
import {
createPaidListing,
type RefundCtx,
setBookingLineQuantity,
setupRefundTest,
} from "#test/lib/server-refunds-helpers.ts";
import {
assertAdminHtml,
expectFlashRedirect,
Expand All @@ -23,12 +29,6 @@ import {
testCookie,
testCsrfToken,
} from "#test-utils/session.ts";
import {
createPaidListing,
type RefundCtx,
setBookingLineQuantity,
setupRefundTest,
} from "./server-refunds-helpers.ts";

// -- Tests ---------------------------------------------------------------- //

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { expect } from "@std/expect";
import { describe, it as test } from "@std/testing/bdd";
import {
createPaidListing,
markAsRefunded,
setupRefundTest,
} from "#test/lib/server-refunds-helpers.ts";
import {
expectFlashRedirect,
expectHtmlResponse,
Expand All @@ -14,11 +19,6 @@ import {
withRefundMock,
} from "#test-utils/refund-routes.ts";
import { testCookie } from "#test-utils/session.ts";
import {
createPaidListing,
markAsRefunded,
setupRefundTest,
} from "./server-refunds-helpers.ts";

describeWithEnv("server (admin refund state)", { db: true }, () => {
describe("already-refunded guard", () => {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/test-utils/refund-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const withRefundMock = async (
refundBehavior: RefundBehavior,
fn: (mockRefund: Stub) => Promise<void>,
options: RefundMockOptions = {},
) => {
): Promise<void> => {
await withStripeProvider(async (provider) => {
const mockRefund = stub(
provider,
Expand Down