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/',
|
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 },
|
|
|
|
},
|
|
|
|
},
|
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' },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
],
|
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__ = '';
|