Skip to content

Commit

Permalink
Merge pull request #15 from Progi1984/supportPSCashOndelivery
Browse files Browse the repository at this point in the history
Added data & pages for using in `ps_cashondelivery`
  • Loading branch information
Progi1984 authored Mar 18, 2024
2 parents 9da959e + f892939 commit f2aebb7
Show file tree
Hide file tree
Showing 48 changed files with 3,946 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
help: ## Display this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

check:
npm run build

test: ## Build and copy to the dependencies directory for the project
rm dist -rf
npm run build
rm $(filter-out $@,$(MAKECMDGOALS))/tests/UI/node_modules/@prestashop-core/ui-testing/dist/ -r
cp dist $(filter-out $@,$(MAKECMDGOALS))/tests/UI/node_modules/@prestashop-core/ui-testing/ -r
cp package.json $(filter-out $@,$(MAKECMDGOALS))/tests/UI/node_modules/@prestashop-core/ui-testing/

.DEFAULT_GOAL := help
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prestashop-core/ui-testing",
"version": "0.0.6",
"version": "0.0.7",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
60 changes: 60 additions & 0 deletions src/data/demo/countries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import CountryData from '@data/faker/country';

export default {
france: new CountryData({
id: 8,
name: 'France',
isoCode: 'FR',
callPrefix: '33',
zone: 'Europe',
active: true,
}),
netherlands: new CountryData({
id: 13,
name: 'Netherlands',
isoCode: 'NL',
callPrefix: '31',
zone: 'Europe',
active: false,
}),
unitedKingdom: new CountryData({
id: 17,
name: 'United Kingdom',
isoCode: 'GB',
callPrefix: '44',
zone: 'Europe',
active: false,
}),
germany: new CountryData({
id: 1,
name: 'Germany',
isoCode: 'DE',
callPrefix: '49',
zone: 'Europe',
active: false,
}),
afghanistan: new CountryData({
id: 231,
name: 'Afghanistan',
isoCode: 'AF',
callPrefix: '93',
zone: 'Asia',
active: false,
}),
unitedStates: new CountryData({
id: 21,
name: 'United States',
isoCode: 'US',
callPrefix: '1',
zone: 'North America',
active: false,
}),
canada: new CountryData({
id: 4,
name: 'Canada',
isoCode: 'CA',
callPrefix: '1',
zone: 'North America',
active: false,
}),
};
139 changes: 139 additions & 0 deletions src/data/demo/currencies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import CurrencyData from '@data/faker/currency';

export default {
euro: new CurrencyData({
name: 'Euro',
frName: 'euro',
symbol: '€',
isoCode: 'EUR',
exchangeRate: 1,
decimals: 2,
enabled: true,
}),
mad: new CurrencyData({
name: 'Moroccan Dirham',
frName: 'dirham marocain',
symbol: 'MAD',
isoCode: 'MAD',
exchangeRate: 10.560000,
decimals: 2,
enabled: true,
}),
toman: new CurrencyData({
name: 'Iranian toman',
frName: 'Toman iranien',
symbol: 'TMN',
isoCode: 'TMN',
exchangeRate: 4666.539,
decimals: 2,
enabled: true,
}),
chileanPeso: new CurrencyData({
name: 'Chilean Peso',
frName: 'peso chilien',
symbol: '$',
isoCode: 'CLP',
exchangeRate: 862.172868,
decimals: 0,
enabled: true,
}),
dzd: new CurrencyData({
name: 'Algerian Dinar',
frName: 'dinar algérien',
symbol: 'DZD',
isoCode: 'DZD',
exchangeRate: 162.6,
decimals: 2,
enabled: true,
}),
tnd: new CurrencyData({
name: 'Tunisian Dinar',
frName: 'dinar tunisien',
symbol: 'TND',
isoCode: 'TND',
exchangeRate: 3.29,
decimals: 3,
enabled: true,
}),
try: new CurrencyData({
name: 'Turkish Lira',
frName: 'livre turque',
symbol: '₺',
isoCode: 'TRY',
exchangeRate: 9.08,
decimals: 2,
enabled: true,
}),
usd: new CurrencyData({
name: 'US Dollar',
frName: 'dollar des États-Unis',
symbol: '$',
isoCode: 'USD',
exchangeRate: 1.22,
decimals: 2,
enabled: true,
}),
aed: new CurrencyData({
name: 'United Arab Emirates Dirham',
frName: 'dirham des Émirats arabes unis',
symbol: 'AED',
isoCode: 'AED',
exchangeRate: 4.51,
decimals: 2,
enabled: true,
}),
lyd: new CurrencyData({
name: 'Libyan Dinar',
frName: 'dinar libyen',
symbol: 'LYD',
isoCode: 'LYD',
exchangeRate: 5.45,
decimals: 3,
enabled: true,
}),
lsl: new CurrencyData({
name: 'Lesotho Loti',
frName: 'loti lesothan',
symbol: 'LSL',
isoCode: 'LSL',
exchangeRate: 18.06,
decimals: 2,
enabled: true,
}),
all: new CurrencyData({
name: 'Albanian Lek',
frName: 'lek albanais',
symbol: 'ALL',
isoCode: 'ALL',
exchangeRate: 123.38,
decimals: 0,
enabled: true,
}),
gbp: new CurrencyData({
name: 'British Pound',
frName: 'livre sterling',
symbol: 'GBP',
isoCode: 'GBP',
exchangeRate: 0.87,
decimals: 2,
enabled: true,
}),
jpy: new CurrencyData({
name: 'Japanese Yen',
frName: 'yen japonais',
symbol: 'JPY',
isoCode: 'JPY',
exchangeRate: 140.59,
decimals: 0,
enabled: true,
}),
pyg: new CurrencyData({
name: 'Paraguayan Guarani',
frName: 'guaraní paraguayen',
symbol: 'PYG',
isoCode: 'PYG',
exchangeRate: 7942.22,
decimals: 0,
enabled: true,
}),
};
100 changes: 100 additions & 0 deletions src/data/demo/orderStatuses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import OrderStatusData from '@data/faker/orderStatus';

export default {
awaitingCheckPayment: new OrderStatusData({
id: 1,
name: 'Awaiting check payment',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: false,
emailTemplate: 'cheque',
}),
paymentAccepted: new OrderStatusData({
id: 2,
name: 'Payment accepted',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: true,
emailTemplate: 'payment',
}),
processingInProgress: new OrderStatusData({
id: 3,
name: 'Processing in progress',
sendEmailOn: true,
deliveryOn: true,
invoiceOn: true,
emailTemplate: 'preparation',
}),
shipped: new OrderStatusData({
id: 4,
name: 'Shipped',
sendEmailOn: true,
deliveryOn: true,
invoiceOn: true,
emailTemplate: 'shipped',
}),
delivered: new OrderStatusData({
id: 5,
name: 'Delivered',
sendEmailOn: false,
deliveryOn: true,
invoiceOn: true,
emailTemplate: '',
}),
canceled: new OrderStatusData({
id: 6,
name: 'Canceled',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: false,
emailTemplate: 'order_canceled',
}),
refunded: new OrderStatusData({
id: 7,
name: 'Refunded',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: true,
emailTemplate: 'refund',
}),
paymentError: new OrderStatusData({
id: 8,
name: 'Payment error',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: false,
emailTemplate: 'payment_error',
}),
awaitingBankWire: new OrderStatusData({
id: 10,
name: 'Awaiting bank wire payment',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: false,
emailTemplate: 'bankwire',
}),
awaitingCashOnDelivery: new OrderStatusData({
id: 13,
name: 'Awaiting Cash On Delivery validation',
sendEmailOn: false,
deliveryOn: false,
invoiceOn: false,
emailTemplate: 'cashondelivery',
}),
onBackorderNotPaid: new OrderStatusData({
id: 12,
name: 'On backorder (not paid)',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: false,
emailTemplate: 'outofstock',
}),
onBackorderPaid: new OrderStatusData({
id: 9,
name: 'On backorder (paid)',
sendEmailOn: true,
deliveryOn: false,
invoiceOn: true,
emailTemplate: 'outofstock',
}),
};
19 changes: 19 additions & 0 deletions src/data/demo/paymentMethods.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import PaymentMethodData from '@data/faker/paymentMethod';

export default {
cashOnDelivery: new PaymentMethodData({
moduleName: 'ps_cashondelivery',
name: 'Cash on delivery (COD)',
displayName: 'Cash on delivery (COD)',
}),
checkPayment: new PaymentMethodData({
moduleName: 'ps_checkpayment',
name: 'Payment by check',
displayName: 'Payments by check',
}),
wirePayment: new PaymentMethodData({
moduleName: 'ps_wirepayment',
name: 'Bank wire',
displayName: 'Bank transfer',
}),
};
28 changes: 28 additions & 0 deletions src/data/demo/states.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import StateData from '@data/faker/state';

export default {
california: new StateData({
id: 8,
name: 'California',
isoCode: 'CA',
country: 'United States',
zone: 'North America',
status: true,
}),
bari: new StateData({
id: 134,
name: 'Bari',
isoCode: 'BA',
country: 'Italy',
zone: 'Europe',
status: true,
}),
bihar: new StateData({
id: 8,
name: 'Bihar',
isoCode: 'BR',
country: 'India',
zone: 'Asia',
status: true,
}),
};
16 changes: 16 additions & 0 deletions src/data/demo/tax.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import TaxData from '@data/faker/tax';

export default {
DefaultFrTax: new TaxData({
id: 1,
name: 'TVA FR 20%',
rate: '20',
enabled: true,
}),
VatUkTax: new TaxData({
id: 15,
name: 'VAT UK 20%',
rate: '20',
enabled: true,
}),
};
Loading

0 comments on commit f2aebb7

Please sign in to comment.