diff --git a/test/lib/server-refunds-ui.test.ts b/test/features/admin/attendee-page-data/refunds-ui.test.ts similarity index 99% rename from test/lib/server-refunds-ui.test.ts rename to test/features/admin/attendee-page-data/refunds-ui.test.ts index b101957571..1b09783997 100644 --- a/test/lib/server-refunds-ui.test.ts +++ b/test/features/admin/attendee-page-data/refunds-ui.test.ts @@ -10,6 +10,12 @@ import { packagesByListingIdFrom, } from "#routes/admin/attendee-page-data.ts"; import type { ExistingLine } from "#shared/db/attendees/atomic-update.ts"; +import { + createPaidListing, + markAsRefunded, + setBookingLineQuantity, + setupRefundTest, +} from "#test/lib/server-refunds-helpers.ts"; import { expectHtmlResponse } from "#test-utils/assertions.ts"; import { describeWithEnv } from "#test-utils/db.ts"; import { @@ -24,12 +30,6 @@ import { } from "#test-utils/db-helpers/listings.ts"; import { testAttendee, testListingWithCount } from "#test-utils/factories.ts"; import { adminGet, withTestSession } from "#test-utils/session.ts"; -import { - createPaidListing, - markAsRefunded, - setBookingLineQuantity, - setupRefundTest, -} from "./server-refunds-helpers.ts"; describeWithEnv("server (admin refund UI)", { db: true }, () => { describe("listing page UI", () => { diff --git a/test/lib/ledger-picker-dates.test.ts b/test/features/admin/ledger/picker-dates.test.ts similarity index 100% rename from test/lib/ledger-picker-dates.test.ts rename to test/features/admin/ledger/picker-dates.test.ts diff --git a/test/routes/api/error-envelope.test.ts b/test/features/api/cors/error-envelope.test.ts similarity index 95% rename from test/routes/api/error-envelope.test.ts rename to test/features/api/cors/error-envelope.test.ts index 3159ef5e85..060321c447 100644 --- a/test/routes/api/error-envelope.test.ts +++ b/test/features/api/cors/error-envelope.test.ts @@ -1,7 +1,7 @@ import { expect } from "@std/expect"; import { describe, it as test } from "@std/testing/bdd"; import { apiError, apiErrorResponse } from "#routes/api/cors.ts"; -import { expectCorsHeaders } from "./helpers.ts"; +import { expectCorsHeaders } from "#test/routes/api/helpers.ts"; describe("apiError", () => { test("responds with the envelope, the status, and CORS headers", async () => { diff --git a/test/routes/api/booking-responses.test.ts b/test/features/api/helpers/booking-responses.test.ts similarity index 96% rename from test/routes/api/booking-responses.test.ts rename to test/features/api/helpers/booking-responses.test.ts index 74f8e48ce3..6a636fc92a 100644 --- a/test/routes/api/booking-responses.test.ts +++ b/test/features/api/helpers/booking-responses.test.ts @@ -6,7 +6,7 @@ import { checkoutResponse, soldOutResponse, } from "#routes/api/helpers.ts"; -import { expectCorsHeaders } from "./helpers.ts"; +import { expectCorsHeaders } from "#test/routes/api/helpers.ts"; describe("bookingSuccessResponse", () => { test("answers with the ticket link and the balance left to collect", async () => { diff --git a/test/lib/server-attendee-form/errors.test.ts b/test/shared/db/attendees/api/errors.test.ts similarity index 99% rename from test/lib/server-attendee-form/errors.test.ts rename to test/shared/db/attendees/api/errors.test.ts index 869c458f7a..6e4d9413ed 100644 --- a/test/lib/server-attendee-form/errors.test.ts +++ b/test/shared/db/attendees/api/errors.test.ts @@ -2,6 +2,7 @@ import { expect } from "@std/expect"; import { describe, it as test } from "@std/testing/bdd"; import { stub } from "@std/testing/mock"; import { attendeesApi } from "#shared/db/attendees/api.ts"; +import { attendeeWithNoBookings } from "#test/lib/server-attendee-form/helpers.ts"; import { describeWithEnv } from "#test-utils/db.ts"; import { attendeeLineFields, @@ -15,7 +16,6 @@ import { } from "#test-utils/db-helpers/listings.ts"; import { withMocks } from "#test-utils/mocks.ts"; import { adminFormPost, adminGet } from "#test-utils/session.ts"; -import { attendeeWithNoBookings } from "./helpers.ts"; describeWithEnv( "server (unified attendee form) — error paths", diff --git a/test/lib/server-attendee-form/overbooking.test.ts b/test/shared/db/attendees/atomic-update/overbooking.test.ts similarity index 99% rename from test/lib/server-attendee-form/overbooking.test.ts rename to test/shared/db/attendees/atomic-update/overbooking.test.ts index 9fa1ec43bb..fdd3bf6271 100644 --- a/test/lib/server-attendee-form/overbooking.test.ts +++ b/test/shared/db/attendees/atomic-update/overbooking.test.ts @@ -1,5 +1,11 @@ import { expect } from "@std/expect"; import { describe, it as test } from "@std/testing/bdd"; +import { + everydayDailyListing, + expectMixedStandardAndDailyLines, + submitNewAttendeeForm, + tomorrowInTz, +} from "#test/lib/server-attendee-form/helpers.ts"; import { expectHtmlResponse } from "#test-utils/assertions.ts"; import { describeWithEnv } from "#test-utils/db.ts"; import { @@ -10,12 +16,6 @@ import { } from "#test-utils/db-helpers/attendees.ts"; import { createTestListing } from "#test-utils/db-helpers/listings.ts"; import { adminFormPost, adminGet } from "#test-utils/session.ts"; -import { - everydayDailyListing, - expectMixedStandardAndDailyLines, - submitNewAttendeeForm, - tomorrowInTz, -} from "./helpers.ts"; describeWithEnv( "server (unified attendee form) — overbooking & mixed timing", diff --git a/test/lib/server-questions/question-delete.test.ts b/test/shared/db/questions/tables/question-delete.test.ts similarity index 98% rename from test/lib/server-questions/question-delete.test.ts rename to test/shared/db/questions/tables/question-delete.test.ts index e2c17442b1..895b4d32ea 100644 --- a/test/lib/server-questions/question-delete.test.ts +++ b/test/shared/db/questions/tables/question-delete.test.ts @@ -1,6 +1,7 @@ // jscpd:ignore-start import { expect } from "@std/expect"; import { describe, it as test } from "@std/testing/bdd"; +import { createQuestion } from "#test/lib/server-questions/helpers.ts"; import { expectFlash, expectFlashRedirect, @@ -10,7 +11,6 @@ import { } from "#test-utils/assertions.ts"; import { describeWithEnv } from "#test-utils/db.ts"; import { adminFormPost, adminGet } from "#test-utils/session.ts"; -import { createQuestion } from "./helpers.ts"; // jscpd:ignore-end diff --git a/test/templates/admin/listings/detail-roster.test.ts b/test/ui/templates/admin/listings/overview/detail-roster.test.ts similarity index 99% rename from test/templates/admin/listings/detail-roster.test.ts rename to test/ui/templates/admin/listings/overview/detail-roster.test.ts index b586bfb642..f9c4030759 100644 --- a/test/templates/admin/listings/detail-roster.test.ts +++ b/test/ui/templates/admin/listings/overview/detail-roster.test.ts @@ -1,12 +1,11 @@ import { expect } from "@std/expect"; import { describe, it as test } from "@std/testing/bdd"; import { ListingDeactivatedBanner } from "#templates/admin/listings/overview.tsx"; -import { testAttendee, testListingWithCount } from "#test-utils/factories.ts"; - import { registerListingTemplateHooks, renderListingDetail, -} from "./helpers.ts"; +} from "#test/templates/admin/listings/helpers.ts"; +import { testAttendee, testListingWithCount } from "#test-utils/factories.ts"; registerListingTemplateHooks(); diff --git a/test/templates/public/view-page.test.ts b/test/ui/templates/tickets/view-page.test.ts similarity index 98% rename from test/templates/public/view-page.test.ts rename to test/ui/templates/tickets/view-page.test.ts index d58d866629..a1ae659472 100644 --- a/test/templates/public/view-page.test.ts +++ b/test/ui/templates/tickets/view-page.test.ts @@ -1,10 +1,9 @@ import { expect } from "@std/expect"; import { describe, it as test } from "@std/testing/bdd"; import { ticketViewPage } from "#templates/tickets.tsx"; +import { registerPublicTemplateHooks } from "#test/templates/public/helpers.ts"; import { testAttendee, testListingWithCount } from "#test-utils/factories.ts"; -import { registerPublicTemplateHooks } from "./helpers.ts"; - registerPublicTemplateHooks(); describe("ticketViewPage listing date and location", () => {