Some checks failed
Build and Deploy / build (push) Has been cancelled
- Fixed OrderNotificationService tests by removing React element prop assertions - Updated admin email tests to match actual function signatures - Fixed AnalyticsService test hoisting issue with vi.hoisted() - Exported AnalyticsService class for test instantiation - Converted require() to dynamic import() in singleton test - All 49 tests now passing - Coverage: 88% statements, 90% functions, 89% lines, 67% branches
113 lines
2.3 KiB
TypeScript
113 lines
2.3 KiB
TypeScript
// Test fixtures for orders
|
|
export const mockOrderPayload = {
|
|
id: "T3JkZXI6MTIzNDU2Nzg=",
|
|
number: 1524,
|
|
user_email: "test@hytham.me",
|
|
first_name: "Test",
|
|
last_name: "Customer",
|
|
billing_address: {
|
|
first_name: "Test",
|
|
last_name: "Customer",
|
|
street_address_1: "123 Test Street",
|
|
street_address_2: "",
|
|
city: "Belgrade",
|
|
postal_code: "11000",
|
|
country: "RS",
|
|
phone: "+38160123456",
|
|
},
|
|
shipping_address: {
|
|
first_name: "Test",
|
|
last_name: "Customer",
|
|
street_address_1: "123 Test Street",
|
|
street_address_2: "",
|
|
city: "Belgrade",
|
|
postal_code: "11000",
|
|
country: "RS",
|
|
phone: "+38160123456",
|
|
},
|
|
lines: [
|
|
{
|
|
id: "T3JkZXJMaW5lOjE=",
|
|
product_name: "Manoon Anti-age Serum",
|
|
variant_name: "50ml",
|
|
quantity: 2,
|
|
total_price_gross_amount: "10000",
|
|
currency: "RSD",
|
|
},
|
|
],
|
|
total_gross_amount: "10000",
|
|
shipping_price_gross_amount: "480",
|
|
channel: {
|
|
currency_code: "RSD",
|
|
},
|
|
language_code: "EN",
|
|
metadata: {},
|
|
};
|
|
|
|
export const mockOrderConverted = {
|
|
id: "T3JkZXI6MTIzNDU2Nzg=",
|
|
number: "1524",
|
|
userEmail: "test@hytham.me",
|
|
user: {
|
|
firstName: "Test",
|
|
lastName: "Customer",
|
|
},
|
|
billingAddress: {
|
|
firstName: "Test",
|
|
lastName: "Customer",
|
|
streetAddress1: "123 Test Street",
|
|
streetAddress2: "",
|
|
city: "Belgrade",
|
|
postalCode: "11000",
|
|
country: "RS",
|
|
phone: "+38160123456",
|
|
},
|
|
shippingAddress: {
|
|
firstName: "Test",
|
|
lastName: "Customer",
|
|
streetAddress1: "123 Test Street",
|
|
streetAddress2: "",
|
|
city: "Belgrade",
|
|
postalCode: "11000",
|
|
country: "RS",
|
|
phone: "+38160123456",
|
|
},
|
|
lines: [
|
|
{
|
|
id: "T3JkZXJMaW5lOjE=",
|
|
productName: "Manoon Anti-age Serum",
|
|
variantName: "50ml",
|
|
quantity: 2,
|
|
totalPrice: {
|
|
gross: {
|
|
amount: 10000,
|
|
currency: "RSD",
|
|
},
|
|
},
|
|
},
|
|
],
|
|
total: {
|
|
gross: {
|
|
amount: 10000,
|
|
currency: "RSD",
|
|
},
|
|
},
|
|
languageCode: "EN",
|
|
metadata: [],
|
|
};
|
|
|
|
export const mockOrderWithTracking = {
|
|
...mockOrderPayload,
|
|
metadata: {
|
|
trackingNumber: "TRK123456789",
|
|
trackingUrl: "https://tracking.example.com/TRK123456789",
|
|
},
|
|
};
|
|
|
|
export const mockOrderCancelled = {
|
|
...mockOrderPayload,
|
|
metadata: {
|
|
cancellationReason: "Customer requested cancellation",
|
|
},
|
|
};
|