2018-11-16 15:43:51 +00:00
|
|
|
// Set up `wp.*` aliases. Doing this because any tests importing wp stuff will likely run into this.
|
|
|
|
global.wp = {};
|
2023-03-07 04:52:36 +00:00
|
|
|
require( '@wordpress/data' );
|
2018-11-30 20:39:16 +00:00
|
|
|
// wcSettings is required by @woocommerce/* packages
|
|
|
|
global.wcSettings = {
|
|
|
|
adminUrl: 'https://vagrant.local/wp/wp-admin/',
|
2024-04-08 08:43:42 +00:00
|
|
|
addressFormats: {
|
|
|
|
default:
|
|
|
|
'{name}\n{company}\n{address_1}\n{address_2}\n{city}\n{state}\n{postcode}\n{country}',
|
|
|
|
JP: '{postcode}\n{state} {city} {address_1}\n{address_2}\n{company}\n{last_name} {first_name}\n{country}',
|
|
|
|
CA: '{company}\n{name}\n{address_1}\n{address_2}\n{city} {state_code} {postcode}\n{country}',
|
|
|
|
},
|
2020-05-20 19:33:16 +00:00
|
|
|
shippingMethodsExist: true,
|
2019-09-23 18:07:13 +00:00
|
|
|
currency: {
|
|
|
|
code: 'USD',
|
|
|
|
precision: 2,
|
|
|
|
symbol: '$',
|
|
|
|
},
|
2021-02-17 13:01:20 +00:00
|
|
|
currentUserIsAdmin: false,
|
2018-11-30 20:39:16 +00:00
|
|
|
date: {
|
|
|
|
dow: 0,
|
|
|
|
},
|
2023-08-07 10:30:53 +00:00
|
|
|
hasFilterableProducts: true,
|
2018-11-30 20:39:16 +00:00
|
|
|
orderStatuses: {
|
|
|
|
pending: 'Pending payment',
|
|
|
|
processing: 'Processing',
|
|
|
|
'on-hold': 'On hold',
|
|
|
|
completed: 'Completed',
|
|
|
|
cancelled: 'Cancelled',
|
|
|
|
refunded: 'Refunded',
|
|
|
|
failed: 'Failed',
|
|
|
|
},
|
2021-04-22 11:37:27 +00:00
|
|
|
placeholderImgSrc: 'placeholder.jpg',
|
|
|
|
productCount: 101,
|
2019-09-23 18:07:13 +00:00
|
|
|
locale: {
|
|
|
|
siteLocale: 'en_US',
|
2018-12-19 15:55:17 +00:00
|
|
|
userLocale: 'en_US',
|
|
|
|
weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
|
|
|
|
},
|
2023-05-31 09:30:44 +00:00
|
|
|
countries: {
|
2021-01-06 09:22:51 +00:00
|
|
|
AT: 'Austria',
|
|
|
|
CA: 'Canada',
|
|
|
|
GB: 'United Kingdom (UK)',
|
|
|
|
},
|
2023-05-31 09:30:44 +00:00
|
|
|
countryData: {
|
|
|
|
AT: {
|
|
|
|
states: {},
|
|
|
|
allowBilling: true,
|
|
|
|
allowShipping: true,
|
|
|
|
locale: {
|
|
|
|
postcode: { priority: 65 },
|
|
|
|
state: { required: false, hidden: true },
|
|
|
|
},
|
2024-04-08 08:43:42 +00:00
|
|
|
format: '{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}',
|
2023-05-31 09:30:44 +00:00
|
|
|
},
|
2021-01-06 09:22:51 +00:00
|
|
|
CA: {
|
2023-05-31 09:30:44 +00:00
|
|
|
states: {
|
|
|
|
ON: 'Ontario',
|
|
|
|
},
|
|
|
|
allowBilling: true,
|
|
|
|
allowShipping: true,
|
|
|
|
locale: {
|
|
|
|
postcode: { label: 'Postal code' },
|
|
|
|
state: { label: 'Province' },
|
|
|
|
},
|
2024-04-08 08:43:42 +00:00
|
|
|
format: '{company}\n{name}\n{address_1}\n{address_2}\n{city} {state_code} {postcode}\n{country}',
|
|
|
|
},
|
|
|
|
JP: {
|
|
|
|
allowBilling: true,
|
|
|
|
allowShipping: true,
|
|
|
|
states: {
|
|
|
|
JP28: 'Hyogo',
|
|
|
|
},
|
|
|
|
locale: {
|
|
|
|
last_name: { priority: 10 },
|
|
|
|
first_name: { priority: 20 },
|
|
|
|
postcode: {
|
|
|
|
priority: 65,
|
|
|
|
},
|
|
|
|
state: {
|
|
|
|
label: 'Prefecture',
|
|
|
|
priority: 66,
|
|
|
|
},
|
|
|
|
city: { priority: 67 },
|
|
|
|
address_1: { priority: 68 },
|
|
|
|
address_2: { priority: 69 },
|
|
|
|
},
|
|
|
|
format: '{postcode}\n{state} {city} {address_1}\n{address_2}\n{company}\n{last_name} {first_name}\n{country}',
|
2023-05-31 09:30:44 +00:00
|
|
|
},
|
|
|
|
GB: {
|
|
|
|
states: {},
|
|
|
|
allowBilling: true,
|
|
|
|
allowShipping: true,
|
|
|
|
locale: {
|
|
|
|
postcode: { label: 'Postcode' },
|
|
|
|
state: { label: 'County', required: false },
|
|
|
|
},
|
2021-01-06 09:22:51 +00:00
|
|
|
},
|
|
|
|
},
|
2021-04-22 11:37:27 +00:00
|
|
|
storePages: {
|
|
|
|
myaccount: {
|
|
|
|
id: 0,
|
|
|
|
title: '',
|
|
|
|
permalink: '',
|
|
|
|
},
|
|
|
|
shop: {
|
|
|
|
id: 0,
|
|
|
|
title: '',
|
|
|
|
permalink: '',
|
|
|
|
},
|
|
|
|
cart: {
|
|
|
|
id: 0,
|
|
|
|
title: '',
|
|
|
|
permalink: '',
|
|
|
|
},
|
|
|
|
checkout: {
|
|
|
|
id: 0,
|
|
|
|
title: '',
|
2023-06-19 15:44:37 +00:00
|
|
|
permalink: 'https://local/checkout/',
|
2021-04-22 11:37:27 +00:00
|
|
|
},
|
|
|
|
privacy: {
|
|
|
|
id: 0,
|
|
|
|
title: '',
|
|
|
|
permalink: '',
|
|
|
|
},
|
|
|
|
terms: {
|
|
|
|
id: 0,
|
|
|
|
title: '',
|
|
|
|
permalink: '',
|
|
|
|
},
|
|
|
|
},
|
2022-10-28 06:38:21 +00:00
|
|
|
attributes: [
|
|
|
|
{
|
|
|
|
attribute_id: '1',
|
|
|
|
attribute_name: 'color',
|
|
|
|
attribute_label: 'Color',
|
|
|
|
attribute_type: 'select',
|
|
|
|
attribute_orderby: 'menu_order',
|
|
|
|
attribute_public: 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
attribute_id: '2',
|
|
|
|
attribute_name: 'size',
|
|
|
|
attribute_label: 'Size',
|
|
|
|
attribute_type: 'select',
|
|
|
|
attribute_orderby: 'menu_order',
|
|
|
|
attribute_public: 0,
|
|
|
|
},
|
|
|
|
],
|
2023-12-15 12:45:38 +00:00
|
|
|
defaultFields: {
|
|
|
|
first_name: {
|
|
|
|
label: 'First name',
|
|
|
|
optionalLabel: 'First name (optional)',
|
|
|
|
autocomplete: 'given-name',
|
|
|
|
autocapitalize: 'sentences',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 10,
|
|
|
|
},
|
|
|
|
last_name: {
|
|
|
|
label: 'Last name',
|
|
|
|
optionalLabel: 'Last name (optional)',
|
|
|
|
autocomplete: 'family-name',
|
|
|
|
autocapitalize: 'sentences',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 20,
|
|
|
|
},
|
|
|
|
company: {
|
|
|
|
label: 'Company',
|
|
|
|
optionalLabel: 'Company (optional)',
|
|
|
|
autocomplete: 'organization',
|
|
|
|
autocapitalize: 'sentences',
|
|
|
|
required: false,
|
|
|
|
hidden: false,
|
|
|
|
index: 30,
|
|
|
|
},
|
|
|
|
address_1: {
|
|
|
|
label: 'Address',
|
|
|
|
optionalLabel: 'Address (optional)',
|
|
|
|
autocomplete: 'address-line1',
|
|
|
|
autocapitalize: 'sentences',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 40,
|
|
|
|
},
|
|
|
|
address_2: {
|
|
|
|
label: 'Apartment, suite, etc.',
|
|
|
|
optionalLabel: 'Apartment, suite, etc. (optional)',
|
|
|
|
autocomplete: 'address-line2',
|
|
|
|
autocapitalize: 'sentences',
|
|
|
|
required: false,
|
|
|
|
hidden: false,
|
|
|
|
index: 50,
|
|
|
|
},
|
|
|
|
country: {
|
|
|
|
label: 'Country/Region',
|
|
|
|
optionalLabel: 'Country/Region (optional)',
|
|
|
|
autocomplete: 'country',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 60,
|
|
|
|
},
|
|
|
|
city: {
|
|
|
|
label: 'City',
|
|
|
|
optionalLabel: 'City (optional)',
|
|
|
|
autocomplete: 'address-level2',
|
|
|
|
autocapitalize: 'sentences',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 70,
|
|
|
|
},
|
|
|
|
state: {
|
|
|
|
label: 'State/County',
|
|
|
|
optionalLabel: 'State/County (optional)',
|
|
|
|
autocomplete: 'address-level1',
|
|
|
|
autocapitalize: 'sentences',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 80,
|
|
|
|
},
|
|
|
|
postcode: {
|
|
|
|
label: 'Postal code',
|
|
|
|
optionalLabel: 'Postal code (optional)',
|
|
|
|
autocomplete: 'postal-code',
|
|
|
|
autocapitalize: 'characters',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 90,
|
|
|
|
},
|
|
|
|
phone: {
|
|
|
|
label: 'Phone',
|
|
|
|
optionalLabel: 'Phone (optional)',
|
|
|
|
autocomplete: 'tel',
|
|
|
|
type: 'tel',
|
|
|
|
required: true,
|
|
|
|
hidden: false,
|
|
|
|
index: 100,
|
|
|
|
},
|
|
|
|
},
|
2024-03-22 14:14:14 +00:00
|
|
|
checkoutData: {
|
|
|
|
order_id: 100,
|
|
|
|
status: 'checkout-draft',
|
|
|
|
order_key: 'wc_order_mykey',
|
|
|
|
order_number: '100',
|
|
|
|
customer_id: 1,
|
|
|
|
},
|
2018-11-30 20:39:16 +00:00
|
|
|
};
|
|
|
|
|
2020-07-14 19:46:44 +00:00
|
|
|
global.jQuery = () => ( {
|
|
|
|
on: () => void null,
|
|
|
|
off: () => void null,
|
|
|
|
} );
|
|
|
|
|
2020-09-07 17:31:10 +00:00
|
|
|
global.IntersectionObserver = function () {
|
2020-08-20 14:14:12 +00:00
|
|
|
return {
|
|
|
|
observe: () => void null,
|
|
|
|
unobserve: () => void null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-12-10 11:11:59 +00:00
|
|
|
global.__webpack_public_path__ = '';
|