## Summary - remove hosted email-payment/payment-link creation from POS and order management - automatically capture authorized card payments instead of exposing a manual capture action - replace provider-specific Stripe wording with card-terminal terminology - retain ordinary terminal payment, receipts, order completion, and navigation - add focused unit and Playwright regression coverage Paired API change: https://github.com/copenhagentruckwash/api/pull/327 ## Verification - focused frontend unit tests: 8/8 passed - desktop card-payment Playwright: 4/4 passed - mobile card-payment Playwright: 15/15 passed - admin order action rail Playwright: 3/3 passed - ESLint, translation generation/checks, build, and diff checks passed - all 18 visual states passed their relevant DOM assertions ## Visual change previews ### View: Regular POS card-payment view **Description:** The hosted email-payment action is removed and provider-specific wording becomes generic card-terminal wording. #### Mobile **Before:**  **After:**  #### Tablet **Before:**  **After:**  #### Desktop **Before:**  **After:**  ### View: Authorized payment capture **Description:** The manual capture action is replaced by an automatically initiated capture and its in-progress state. #### Mobile **Before:**  **After:**  #### Tablet **Before:**  **After:**  #### Desktop **Before:**  **After:**  ### View: Order-dashboard action rail **Description:** The hosted Stripe invoice/payment-link action is removed while normal order actions remain. #### Mobile **Before:**  **After:**  #### Tablet **Before:**  **After:**  #### Desktop **Before:**  **After:**  ## Residual risk No live Stripe Terminal hardware or production Stripe account was used. Browser behavior is verified with repository-owned mocks; the API suite verifies route and payment-intent lifecycle wiring.
46 lines
2.2 KiB
JavaScript
46 lines
2.2 KiB
JavaScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const root = process.cwd();
|
|
const stripeManageSource = readFileSync(
|
|
join(
|
|
root,
|
|
"src/views/dashboards/superUserDashboard/collectedOrderInvoice/displays/manage/collectedOrderInvoiceManageStripe.vue"
|
|
),
|
|
"utf8"
|
|
);
|
|
|
|
describe("collected invoice stripe queue wiring", () => {
|
|
it("uses shared queue composable with collected-invoice queue endpoints", () => {
|
|
expect(stripeManageSource).toContain("useEconomicQueueJob");
|
|
expect(stripeManageSource).toContain('enqueueEndpoint: "/collected-invoices/stripe/book"');
|
|
expect(stripeManageSource).toContain('statusEndpoint: "/collected-invoices/economic/queue/status"');
|
|
expect(stripeManageSource).toContain('retryEndpoint: "/collected-invoices/economic/queue/retry"');
|
|
expect(stripeManageSource).toContain("await stripeTransferQueue.enqueue({});");
|
|
expect(stripeManageSource).toContain("await stripeTransferQueue.retry();");
|
|
});
|
|
|
|
it("renders progress and retry states for queued transfers", () => {
|
|
expect(stripeManageSource).toContain("isStripeTransferQueuedOrProcessing");
|
|
expect(stripeManageSource).toContain("isStripeTransferFailed");
|
|
expect(stripeManageSource).toContain(
|
|
"const canBookStripeInvoice = computed(() => !isStripeTransferBusy.value && !isStripeTransferCompleted.value);"
|
|
);
|
|
expect(stripeManageSource).toContain('data-testid="collected-stripe-progress"');
|
|
expect(stripeManageSource).toContain('data-testid="collected-stripe-retry"');
|
|
expect(stripeManageSource).toContain('data-testid="collected-stripe-book-invoice"');
|
|
});
|
|
|
|
it("prevents duplicate queue submissions after a completed Stripe transfer", () => {
|
|
expect(stripeManageSource).toContain("if (!canBookStripeInvoice.value)");
|
|
expect(stripeManageSource).toContain(':disabled="!canBookStripeInvoice"');
|
|
expect(stripeManageSource).toContain("isStripeTransferCompleted.value");
|
|
});
|
|
|
|
it("does not expose manual payment capture", () => {
|
|
expect(stripeManageSource).not.toContain("capturePaymentIntent(");
|
|
expect(stripeManageSource).not.toContain("stripePayment.amount_capturable > 0");
|
|
});
|
|
});
|