chore: remediate CI blockers for production readiness
This commit is contained in:
@@ -132,6 +132,32 @@ describe('CheckoutModal', () => {
|
||||
provider: 'VNPAY',
|
||||
type: 'SUBSCRIPTION',
|
||||
amountVND: 499000,
|
||||
returnUrl: 'http://localhost:3000/vi/payment/return',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('uses the locale root payment return route from dashboard checkout', async () => {
|
||||
Object.defineProperty(window, 'location', {
|
||||
writable: true,
|
||||
value: {
|
||||
...window.location,
|
||||
href: 'http://localhost:3000/vi/dashboard/subscription',
|
||||
origin: 'http://localhost:3000',
|
||||
pathname: '/vi/dashboard/subscription',
|
||||
},
|
||||
});
|
||||
|
||||
render(
|
||||
<CheckoutModal open={true} onOpenChange={onOpenChange} plan={basePlan} billingCycle="monthly" />,
|
||||
);
|
||||
await userEvent.click(screen.getByRole('button', { name: /thanh toán/i }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockCreatePayment).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
returnUrl: 'http://localhost:3000/vi/payment/return',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user