Refactor infra tests, clean E2E step suites, and fix TS in tests
This commit is contained in:
@@ -23,7 +23,7 @@ describe('ConfirmCheckoutUseCase', () => {
|
||||
requestCheckoutConfirmation: Mock;
|
||||
};
|
||||
let mockPrice: CheckoutPrice;
|
||||
|
||||
|
||||
beforeEach(() => {
|
||||
mockCheckoutService = {
|
||||
extractCheckoutInfo: vi.fn(),
|
||||
@@ -33,12 +33,12 @@ describe('ConfirmCheckoutUseCase', () => {
|
||||
mockConfirmationPort = {
|
||||
requestCheckoutConfirmation: vi.fn(),
|
||||
};
|
||||
|
||||
|
||||
mockPrice = {
|
||||
getAmount: vi.fn(() => 0.50),
|
||||
toDisplayString: vi.fn(() => '$0.50'),
|
||||
isZero: vi.fn(() => false),
|
||||
};
|
||||
} as unknown as CheckoutPrice;
|
||||
});
|
||||
|
||||
describe('Success flow', () => {
|
||||
@@ -230,11 +230,11 @@ describe('ConfirmCheckoutUseCase', () => {
|
||||
|
||||
describe('Zero price warning', () => {
|
||||
it('should still require confirmation for $0.00 price', async () => {
|
||||
const zeroPriceMock: CheckoutPrice = {
|
||||
const zeroPriceMock = {
|
||||
getAmount: vi.fn(() => 0.00),
|
||||
toDisplayString: vi.fn(() => '$0.00'),
|
||||
isZero: vi.fn(() => true),
|
||||
};
|
||||
} as unknown as CheckoutPrice;
|
||||
|
||||
const useCase = new ConfirmCheckoutUseCase(
|
||||
mockCheckoutService as unknown as ICheckoutService,
|
||||
@@ -263,11 +263,11 @@ describe('ConfirmCheckoutUseCase', () => {
|
||||
});
|
||||
|
||||
it('should proceed with checkout for zero price after confirmation', async () => {
|
||||
const zeroPriceMock: CheckoutPrice = {
|
||||
const zeroPriceMock = {
|
||||
getAmount: vi.fn(() => 0.00),
|
||||
toDisplayString: vi.fn(() => '$0.00'),
|
||||
isZero: vi.fn(() => true),
|
||||
};
|
||||
} as unknown as CheckoutPrice;
|
||||
|
||||
const useCase = new ConfirmCheckoutUseCase(
|
||||
mockCheckoutService as unknown as ICheckoutService,
|
||||
|
||||
Reference in New Issue
Block a user