@wikala/spmkt 2.31.1 → 3.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/MIGRATION_GUIDE.md +261 -0
  2. package/api/product.js +1 -0
  3. package/api/request.js +9 -4
  4. package/api/user.js +1 -1
  5. package/components/Account/AccountDashboard.vue +101 -101
  6. package/components/Account/AccountStore.js +57 -31
  7. package/components/Account/AffiliateReport.vue +56 -60
  8. package/components/Account/{OrderDetail.vue → Orders/OrderDetail.vue} +44 -30
  9. package/components/Account/Orders/Orders.vue +124 -0
  10. package/components/Account/{AccountSettings.vue → Settings/AccountSettings.vue} +4 -4
  11. package/components/Account/Settings/ChangeEmail.vue +136 -0
  12. package/components/Account/Settings/ChangeName.vue +82 -0
  13. package/components/Account/Settings/ChangePassword.vue +91 -0
  14. package/components/Address/Address.vue +38 -57
  15. package/components/Address/AddressBook.vue +77 -57
  16. package/components/Address/AddressSelect.vue +94 -87
  17. package/components/Address/Edit.vue +253 -265
  18. package/components/Address/PostalCode.vue +22 -21
  19. package/components/AgeGate.vue +11 -5
  20. package/components/Auth/Login.vue +62 -44
  21. package/components/Auth/Register.vue +82 -60
  22. package/components/Auth/ResetPassword.vue +45 -30
  23. package/components/Cart/AgeVerification/AgeChecker.vue +3 -3
  24. package/components/Cart/CartBadge.vue +15 -4
  25. package/components/Cart/CartBox.vue +19 -11
  26. package/components/Cart/CartItem.vue +3 -3
  27. package/components/Cart/CartMode.vue +6 -5
  28. package/components/Cart/CartPreview.vue +24 -18
  29. package/components/Cart/CreditCard/Everyware.vue +10 -10
  30. package/components/Cart/CreditCard/ExtendedCreditCard.vue +5 -5
  31. package/components/Cart/CreditCard/SquarePay.vue +18 -16
  32. package/components/Cart/CreditCard/StandardCreditCard.vue +9 -9
  33. package/components/Cart/Delivery/Delivery.vue +16 -12
  34. package/components/Cart/Delivery/DeliveryAddress.vue +1 -1
  35. package/components/Cart/Delivery/DeliveryMethods.vue +1 -1
  36. package/components/Cart/Delivery/DeliveryOptions.vue +15 -9
  37. package/components/Cart/Delivery/DeliveryTypes.vue +8 -5
  38. package/components/Cart/Delivery/ReservationSlots.vue +14 -8
  39. package/components/Cart/Disclaimer.vue +1 -1
  40. package/components/Cart/OrderConfirmation.vue +1 -1
  41. package/components/Cart/Payment/Payment.vue +37 -33
  42. package/components/Cart/Payment/PaymentMethods.vue +6 -4
  43. package/components/Cart/ReviewAndSubmit.vue +9 -7
  44. package/components/Cart/ShoppingCart.vue +42 -31
  45. package/components/Cart/Store/actions.js +1 -1
  46. package/components/Cart/Store/getters.js +2 -1
  47. package/components/Cart/Store/index.js +1 -1
  48. package/components/Cart/Store/mutations.js +7 -5
  49. package/components/Cart/UserIdentity.vue +1 -1
  50. package/components/Category/CategoryFilter.vue +128 -114
  51. package/components/Category/CategorySort.vue +44 -32
  52. package/components/Category/LoadMore.vue +39 -23
  53. package/components/DeliverTo.vue +10 -15
  54. package/components/DeliveryNotice.vue +72 -68
  55. package/components/DobInput.vue +23 -23
  56. package/components/Gmaps/GmapsAutocomplete.vue +139 -78
  57. package/components/Gmaps/GmapsLocations.vue +1 -1
  58. package/components/Gmaps/GmapsSingleLocation.vue +121 -87
  59. package/components/ModalContainer/ModalContainer.vue +12 -9
  60. package/components/ModalContainer/index.js +61 -18
  61. package/components/Product/AddToCart.vue +237 -221
  62. package/components/Product/BoxAddToCart.vue +114 -86
  63. package/components/Product/Compare.vue +68 -48
  64. package/components/Product/CompareBox.vue +128 -123
  65. package/components/Product/Lookup.vue +92 -65
  66. package/components/Product/Photo.vue +105 -66
  67. package/components/Product/Price.vue +64 -43
  68. package/components/Product/ProductAutocomplete.vue +52 -57
  69. package/components/Product/ProductBox.vue +61 -38
  70. package/components/Product/ProductImages.vue +83 -86
  71. package/components/Product/Quantity.vue +115 -53
  72. package/components/Product/QuickView.vue +52 -45
  73. package/components/Product/RelatedProducts.vue +88 -23
  74. package/components/Product/SKU.vue +27 -8
  75. package/components/Product/Variants.vue +335 -341
  76. package/components/Product/reviews-questions/ProductQuestions.vue +226 -198
  77. package/components/Product/reviews-questions/ProductReviews.vue +122 -107
  78. package/components/Product/reviews-questions/Review.vue +54 -59
  79. package/components/Product/reviews-questions/ReviewForm.vue +222 -170
  80. package/components/Product/reviews-questions/ReviewImages.vue +197 -216
  81. package/components/Product/reviews-questions/Vote.vue +83 -57
  82. package/components/QuantityInput.vue +18 -8
  83. package/components/RangeInput.vue +15 -8
  84. package/components/Recaptcha.vue +8 -1
  85. package/components/SelectShippingCountry.vue +81 -62
  86. package/components/TimedOffer.vue +59 -74
  87. package/composables/globals.js +53 -0
  88. package/config.js +5 -2
  89. package/index.js +41 -10
  90. package/install.js +75 -0
  91. package/locales/en.json +2 -1
  92. package/locales/sr.json +2 -1
  93. package/package.json +43 -30
  94. package/utils/directives.js +28 -45
  95. package/utils/event-bus.js +56 -0
  96. package/utils/filters.js +24 -7
  97. package/utils/{gmaps.js → google/gmaps.js} +43 -10
  98. package/utils/{google-analytics-eec.js → google/google-analytics-eec.js} +7 -7
  99. package/babel.config.js +0 -5
  100. package/components/Account/ChangeEmail.vue +0 -133
  101. package/components/Account/ChangeName.vue +0 -92
  102. package/components/Account/ChangePassword.vue +0 -94
  103. package/components/Account/CreditCards.vue +0 -18
  104. package/components/Account/Orders.vue +0 -110
  105. package/components/Account/Settings.vue +0 -18
  106. package/components/Cart/Delivery/DeliveryAddressGuest.spec.js +0 -128
  107. package/components/Cart/Delivery/DeliveryTypes.spec.js +0 -83
  108. package/components/Cart/PCIBadge/SecurityMetrics.vue +0 -11
  109. package/components/Instagram.vue +0 -49
  110. package/components/ProductImageModal.vue +0 -41
  111. package/jest.config.js +0 -16
  112. package/test/e2e/.babelrc.js +0 -8
  113. package/test/e2e/.eslintrc.js +0 -11
  114. package/test/e2e/accAuth.spec.js +0 -64
  115. package/test/e2e/ageGate.spec.js +0 -26
  116. package/test/e2e/checkout.spec.js +0 -106
  117. package/test/e2e/compare.spec.js +0 -52
  118. package/test/e2e/config/data.js +0 -21
  119. package/test/e2e/config/routes.js +0 -11
  120. package/test/e2e/region.spec.js +0 -46
  121. package/test/e2e/search.spec.js +0 -32
  122. package/tests/vueBuefy.js +0 -4
  123. package/tsconfig.json +0 -8
@@ -1,92 +0,0 @@
1
- <template>
2
- <div class="name-wrapper">
3
- <div class="name-header">
4
- <p>{{ $t('account.memberSince') }}</p>
5
- <p>{{ userData.member_since }}</p>
6
- </div>
7
-
8
- <div class="columns is-gapless">
9
- <div class="column is-one-third">
10
- <b-field :label="$t('address.firstName')" label-position="inside" :type="{ 'is-danger': errors.first_name }" :message="errors.first_name">
11
- <b-input native-value="inside" @input="clearError('first_name')" v-model="userData.first_name"></b-input>
12
- </b-field>
13
-
14
- <b-field :label="$t('address.lastName')" label-position="inside" :type="{ 'is-danger': errors.last_name }" :message="errors.last_name">
15
- <b-input native-value="inside" @input="clearError('last_name')" v-model="userData.last_name"></b-input>
16
- </b-field>
17
-
18
- <dob-input
19
- v-if="parseInt(initialState.age_verification.enabled)"
20
- :value="userData.date_of_birth"
21
- :error="errors.date_of_birth"
22
- @input="onDobInput"
23
- ></dob-input>
24
- </div>
25
- </div>
26
-
27
- <button type="button" @click="warningMessage" class="button is-primary change-name">{{ $t('global.save') }}</button>
28
- </div>
29
- </template>
30
-
31
- <script>
32
- import { User } from '../../api'
33
-
34
- import DobInput from '../../components/DobInput'
35
-
36
- export default {
37
- name: 'ChangeName',
38
- components: { DobInput },
39
- props: {
40
- userData: Object
41
- },
42
-
43
- data() {
44
- return {
45
- errors: {}
46
- }
47
- },
48
-
49
- methods: {
50
- onDobInput(val) {
51
- this.userData.date_of_birth = val
52
- },
53
-
54
- submit() {
55
- User.updateName(this.userData)
56
- .then(() => {
57
- this.$buefy.toast.open({
58
- message: this.$t('account.savedNotification'),
59
- type: 'is-success'
60
- })
61
- })
62
- .catch((error) => {
63
- if (error.errors !== undefined) {
64
- this.errors = error.errors
65
- }
66
- })
67
-
68
- User.updateDateOfBirth(this.userData).catch((error) => {
69
- this.errors = error.errors
70
- })
71
- },
72
-
73
- clearError(field) {
74
- if (this.errors[field]) {
75
- this.errors[field] = ''
76
- }
77
- },
78
-
79
- warningMessage() {
80
- this.$buefy.dialog.confirm({
81
- title: this.$t('account.dialogTitle'),
82
- message: this.$t('account.confirm'),
83
- confirmText: 'Ok',
84
- type: 'is-info',
85
- onConfirm: () => {
86
- this.submit()
87
- }
88
- })
89
- }
90
- }
91
- }
92
- </script>
@@ -1,94 +0,0 @@
1
- <template>
2
- <div class="password-wrapper column-wrapper">
3
- <div class="password-header">
4
- <p>Password</p>
5
- </div>
6
- <div class="columns-wrapper">
7
- <div class="columns is-gapless">
8
- <div class="column is-one-third">
9
- <b-field
10
- :label="$t('account.lCurrentPassword')"
11
- label-position="inside"
12
- :type="{ 'is-danger': errors.current_password }"
13
- :message="errors.current_password"
14
- >
15
- <b-input type="password" native-value="inside" @input="clearError('current_password')" v-model="user.current_password"></b-input>
16
- </b-field>
17
-
18
- <b-field :label="$t('account.lNewPassword')" label-position="inside" :type="{ 'is-danger': errors.new_password }" :message="errors.new_password">
19
- <b-input type="password" native-value="inside" @input="clearError('new_password')" v-model="user.new_password"></b-input>
20
- </b-field>
21
-
22
- <b-field :label="$t('account.lConfirmNewPassword')" label-position="inside">
23
- <b-input type="password" native-value="inside" @input="clearError('new_password')" v-model="user.new_password_confirmation"></b-input>
24
- </b-field>
25
- </div>
26
-
27
- <div class="column"></div>
28
- </div>
29
-
30
- <button type="button" @click="warningMessage" class="button is-primary change-password">{{ $t('account.changePassword') }}</button>
31
- </div>
32
- </div>
33
- </template>
34
-
35
- <script>
36
- import { User } from '../../api'
37
-
38
- export default {
39
- name: 'ChangePassword',
40
- data() {
41
- return {
42
- errors: {},
43
- user: {
44
- current_password: '',
45
- new_password: '',
46
- new_password_confirmation: ''
47
- }
48
- }
49
- },
50
- methods: {
51
- submit() {
52
- User.updatePassword(this.user)
53
- .then((response) => {
54
- if (response.status === 200 || response.status === 201) {
55
- this.$buefy.toast.open({
56
- message: this.$t('account.passwordChangedNotification'),
57
- type: 'is-success'
58
- })
59
- } else {
60
- this.$buefy.dialog.alert({
61
- title: this.$t('account.dialogTitle'),
62
- message: this.$t('account.passwordChangeErrorNotification'),
63
- confirmText: 'OK',
64
- type: 'is-info'
65
- })
66
- }
67
- })
68
- .catch((error) => {
69
- if (error.errors !== undefined) {
70
- this.errors = error.errors
71
- }
72
- })
73
- },
74
-
75
- clearError(field) {
76
- if (this.errors[field]) {
77
- this.errors[field] = ''
78
- }
79
- },
80
-
81
- warningMessage() {
82
- this.$buefy.dialog.confirm({
83
- title: this.$t('account.dialogTitle'),
84
- message: this.$t('account.passwordChangeConfirm'),
85
- confirmText: 'Ok',
86
- type: 'is-info',
87
- onConfirm: () => {
88
- this.submit()
89
- }
90
- })
91
- }
92
- }
93
- }
94
- </script>
@@ -1,18 +0,0 @@
1
- <template>
2
- <div>
3
- <p>Credit Cards</p>
4
- </div>
5
- </template>
6
-
7
-
8
- <script>
9
- export default {
10
- name:'CreditCards',
11
- data() {
12
- return {
13
-
14
- }
15
- },
16
- }
17
-
18
- </script>
@@ -1,110 +0,0 @@
1
- <template>
2
- <div>
3
- <b-table v-if="!showOrderDetail && orders.length !== 0" :data="orders" :selected.sync="selected" :hoverable="true" @select="select" class="orders-table">
4
- <b-table-column v-slot="props" field="id" label="ID" width="40" numeric sortable>
5
- {{ props.row.id }}
6
- </b-table-column>
7
-
8
- <b-table-column v-slot="props" field="date" label="Date" width="60" sortable>
9
- <span class="tag">
10
- {{ new Date(props.row.date).toLocaleDateString() }}
11
- </span>
12
- </b-table-column>
13
-
14
- <b-table-column v-slot="props" field="total" label="Total" width="200" numeric sortable>
15
- {{ props.row.total }}
16
- </b-table-column>
17
-
18
- <b-table-column v-slot="props" field="order_status.name" label="Status">
19
- {{ props.row.order_status.name }}
20
- </b-table-column>
21
- </b-table>
22
-
23
- <div v-if="!orders.length">{{ noOrdersNotification }}</div>
24
-
25
- <div v-if="showOrderDetail">
26
- <OrderDetail :title="$t('global.order') + ' #' + selected.id" :id="selected.id"></OrderDetail>
27
- </div>
28
- </div>
29
- </template>
30
-
31
- <script>
32
- import { Order } from '../../api'
33
- import OrderDetail from './OrderDetail'
34
-
35
- export default {
36
- name: 'Orders',
37
- components: { OrderDetail },
38
- props: {
39
- noOrdersNotification: {
40
- type: String,
41
- default: function () {
42
- return this.$t('account.ordersEmpty')
43
- }
44
- },
45
- },
46
- data() {
47
- return {
48
- selected: {},
49
- orders: [],
50
- orderItems: [],
51
- orderTotal: 0,
52
- openedDetailed: [],
53
- showOrderDetail: false,
54
- loadingOrders: null
55
- }
56
- },
57
- methods: {
58
- getOrders() {
59
- Order.getList()
60
- .then((response) => {
61
- this.orders = response.data.data
62
- //console.log('orders ', this.orders)
63
- this.loadingOrders.close()
64
- })
65
- .catch((error) => {
66
- console.log('Order loading error', error)
67
- })
68
- },
69
-
70
- select(row, oldRow) {
71
- this.showOrderDetail = true
72
- history.pushState(
73
- null,
74
- this.initialState.site_name + ' ' + this.$t('account.orders') + ' > ' + this.$t('global.order') + ' #' + row.id,
75
- '/account?tab=orders&id=' + row.id
76
- )
77
- },
78
-
79
- orderDetailClose() {
80
- this.selected = {}
81
- this.showOrderDetail = false
82
- },
83
-
84
- init() {
85
- this.loadingOrders = this.$buefy.loading.open()
86
- let urlOrderId = parseInt(new URL(document.location).searchParams.get('id'))
87
- if (urlOrderId) {
88
- this.selected = { id: urlOrderId }
89
- this.showOrderDetail = true
90
- if (this.orders.length === 0) {
91
- this.getOrders()
92
- }
93
- } else {
94
- this.getOrders()
95
- }
96
- }
97
- },
98
-
99
- mounted() {
100
- this.init()
101
-
102
- this.$bus.$on('orderDetailClose', this.orderDetailClose)
103
-
104
- window.addEventListener('popstate', () => {
105
- console.log('popstate orders', window.location.href, this.$parent)
106
- this.showOrderDetail = false
107
- })
108
- }
109
- }
110
- </script>
@@ -1,18 +0,0 @@
1
- <template>
2
- <div>
3
- <p>Settings</p>
4
- </div>
5
- </template>
6
-
7
-
8
- <script>
9
- export default {
10
- name:'Settings',
11
- data() {
12
- return {
13
-
14
- }
15
- },
16
- }
17
-
18
- </script>
@@ -1,128 +0,0 @@
1
- import { shallowMount, createLocalVue } from '@vue/test-utils'
2
- import DeliveryAddressGuest from './DeliveryAddressGuest.vue'
3
-
4
- fdescribe('DeliveryAddressGuest', () => {
5
- let wrapper
6
-
7
- beforeEach(() => {
8
- const localVue = createLocalVue()
9
- wrapper = shallowMount(DeliveryAddressGuest, {
10
- localVue,
11
- mocks: {
12
- $t: jest.fn(),
13
- $buefy: {
14
- loading: {
15
- open: jest.fn(),
16
- close: jest.fn()
17
- },
18
- dialog: {
19
- alert: jest.fn()
20
- },
21
- toast: {
22
- open: jest.fn()
23
- }
24
- }
25
- },
26
- stubs: {
27
- Address: true,
28
- EditAddress: true,
29
- DeliveryMethods: true
30
- }
31
- })
32
- })
33
-
34
- afterEach(() => {
35
- wrapper.destroy()
36
- })
37
-
38
- it('renders the component', () => {
39
- expect(wrapper.exists()).toBe(true)
40
- })
41
-
42
- it('initializes with correct data', () => {
43
- expect(wrapper.vm.addressValid).toBe(false)
44
- expect(wrapper.vm.validationErrors).toEqual({})
45
- expect(wrapper.vm.editAutocompleteAddress).toBe(false)
46
- })
47
-
48
- it('calls onGmapsPlaceInput method correctly', () => {
49
- const pl = {
50
- street: '123 Main St',
51
- city: 'New York',
52
- state: 'NY',
53
- country: 'USA'
54
- }
55
- wrapper.vm.checkoutRequestData.shipping_address = {
56
- street: '',
57
- city: '',
58
- state: '',
59
- country: ''
60
- }
61
- wrapper.vm.onGmapsPlaceInput(pl)
62
- expect(wrapper.vm.validationErrors).toEqual({})
63
- expect(wrapper.vm.editAutocompleteAddress).toBe(false)
64
- expect(wrapper.vm.checkoutRequestData.shipping_address).toEqual(pl)
65
- })
66
-
67
- it('calls onAddressContinue method correctly', async () => {
68
- const geocodeResult = 'OK'
69
- const validateAddressResult = {
70
- valid: true
71
- }
72
- const getAvailableDeliveryMethodsResult = [
73
- { id: 1, name: 'Standard Delivery' },
74
- { id: 2, name: 'Express Delivery' }
75
- ]
76
- wrapper.vm.geocodeAddress = jest.fn().mockResolvedValue(geocodeResult)
77
- wrapper.vm.validateAddress = jest.fn().mockResolvedValue(validateAddressResult)
78
- wrapper.vm.getAvailableDeliveryMethods = jest.fn().mockResolvedValue(getAvailableDeliveryMethodsResult)
79
-
80
- await wrapper.vm.onAddressContinue()
81
-
82
- expect(wrapper.vm.addressValid).toBe(true)
83
- expect(wrapper.emitted('addressValidation')[0]).toEqual([true])
84
- expect(wrapper.vm.setBillingAddress).toHaveBeenCalledWith(wrapper.vm.checkoutRequestData.shipping_address)
85
- expect(wrapper.vm.getAvailableDeliveryMethods).toHaveBeenCalledWith(wrapper.vm.checkoutRequestData.shipping_address)
86
- expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith('.delivery-method')
87
- })
88
-
89
- it('calls onChangeDeliveryAddress method correctly', () => {
90
- wrapper.vm.onChangeDeliveryAddress()
91
- expect(wrapper.vm.addressValid).toBe(false)
92
- expect(wrapper.vm.editAutocompleteAddress).toBe(true)
93
- expect(wrapper.emitted('addressValidation')[0]).toEqual([false])
94
- })
95
-
96
- it('calls deliveryMethodSelected method correctly', () => {
97
- const deliveryCost = { id: 1, name: 'Standard Delivery' }
98
- wrapper.vm.deliveryMethodSelected(deliveryCost)
99
- expect(wrapper.vm.getSummary).toHaveBeenCalledWith({
100
- country_id: wrapper.vm.checkoutRequestData.shipping_address.country_id,
101
- state_id: wrapper.vm.checkoutRequestData.shipping_address.state_id,
102
- delivery_cost_id: deliveryCost.id
103
- })
104
- expect(wrapper.emitted('deliveryMethodSelected')[0]).toEqual([deliveryCost])
105
- })
106
-
107
- it('calls setDeliveryAddressUserIdentity method correctly', () => {
108
- const initialState = {
109
- orderAsBusiness: '0'
110
- }
111
- const userIdentity = {
112
- first_name: 'John',
113
- last_name: 'Doe',
114
- phone: '1234567890'
115
- }
116
- const countryList = ['USA', 'Canada']
117
- wrapper.vm.initialState = initialState
118
- wrapper.vm.userIdentity = userIdentity
119
- wrapper.vm.countryList = countryList
120
-
121
- wrapper.vm.setDeliveryAddressUserIdentity()
122
-
123
- expect(wrapper.vm.setDeliveryAddress).toHaveBeenCalledWith(expect.any(Object))
124
- expect(wrapper.vm.checkoutRequestData.shipping_address.first_name).toBe(userIdentity.first_name)
125
- expect(wrapper.vm.checkoutRequestData.shipping_address.last_name).toBe(userIdentity.last_name)
126
- expect(wrapper.vm.checkoutRequestData.shipping_address.phone).toBe(userIdentity.phone)
127
- })
128
- })
@@ -1,83 +0,0 @@
1
-
2
- import { mount } from '@vue/test-utils'
3
- import DeliveryTypes from '@/components/Cart/Delivery/DeliveryTypes.vue'
4
-
5
- describe('DeliveryTypes', () => {
6
- let wrapper
7
- const deliveryTypesMock = [
8
- { type: 'pickup', name: 'Pickup', description: 'Pick up your order from the store' },
9
- { type: 'delivery', name: 'Delivery', description: 'Get your order delivered to your address' }
10
- ]
11
-
12
- beforeEach(() => {
13
- wrapper = mount(DeliveryTypes, {
14
- propsData: {
15
- value: 'pickup',
16
- error: false
17
- },
18
- computed: {
19
- deliveryTypes: () => deliveryTypesMock
20
- },
21
-
22
- })
23
- })
24
-
25
- it('renders the delivery types', () => {
26
- const deliveryMethods = wrapper.findAll('.delivery-methods .b-radio')
27
- expect(deliveryMethods.length).toBe(2)
28
-
29
- const firstDeliveryMethod = deliveryMethods.at(0)
30
- expect(firstDeliveryMethod.find('div').text()).toBe('Pickup')
31
-
32
- const secondDeliveryMethod = deliveryMethods.at(1)
33
- expect(secondDeliveryMethod.find('div').text()).toBe('Delivery')
34
- })
35
-
36
- it('emits the selected delivery type on input', async () => {
37
- const deliveryMethodInputs = wrapper.findAll('.delivery-methods .b-radio input')
38
- const secondDeliveryMethodInput = deliveryMethodInputs.at(1)
39
-
40
- await secondDeliveryMethodInput.setChecked(true)
41
-
42
- expect(wrapper.emitted().input).toBeTruthy()
43
- expect(wrapper.emitted().input[1]).toEqual(['delivery'])
44
- })
45
-
46
- it('sets the default delivery type if deliveryTypes is not empty', () => {
47
- expect(wrapper.emitted().input).toBeTruthy()
48
- expect(wrapper.emitted().input[0]).toEqual(['pickup'])
49
- })
50
-
51
- it('does not set the default delivery type if deliveryTypes is empty', () => {
52
- wrapper = mount(DeliveryTypes, {
53
- propsData: {
54
- value: 'pickup',
55
- error: false
56
- },
57
- computed: {
58
- deliveryTypes: () => []
59
- }
60
- })
61
-
62
- expect(wrapper.emitted().input).toBeFalsy()
63
- })
64
-
65
- it('renders the error message if error is true', () => {
66
- wrapper = mount(DeliveryTypes, {
67
- propsData: {
68
- value: 'pickup',
69
- error: true
70
- },
71
- computed: {
72
- deliveryTypes: () => deliveryTypesMock
73
- }
74
- })
75
-
76
- expect(wrapper.find('.help.is-danger').text()).toBe('Please choose delivery method')
77
- })
78
-
79
- it('does not render the error message if error is false', () => {
80
- expect(wrapper.find('.help.is-danger').exists()).toBe(false)
81
- })
82
-
83
- })
@@ -1,11 +0,0 @@
1
- <template functional>
2
- <div>
3
- <a href="//www.securitymetrics.com/site_certificate?id=1676708&tk=b0f62300a408dbdf054377c74eaddaec" target="_blank" rel="noopener noreferrer">
4
- <img
5
- class="security-metrics-badge"
6
- src="https://www.securitymetrics.com/static/apps/super/assets/img/Credit_Card_Safe_light.png"
7
- alt="SecurityMetrics Credit Card Safe"
8
- />
9
- </a>
10
- </div>
11
- </template>
@@ -1,49 +0,0 @@
1
- <template>
2
- <div :class="{ container: hasContainer }">
3
- <h2 v-if="title" class="instagramTitle subtitle is-size-3 has-text-weight-semibold">
4
- {{ title }}
5
- </h2>
6
- <VueInstagram id="instagram" :token="token" :count="count" class="columns is-mobile is-multiline">
7
- <template v-slot:loading="props">
8
- <p v-if="props.loading" class="title is-1">Loading, please wait...</p>
9
- </template>
10
-
11
- <template v-slot:feeds="props">
12
- <a :href="props.feed.link" class="column is-half-mobile" target="_blank" ref="noreferrer" rel="noopener">
13
- <div class="instaItem">
14
- <img :src="props.feed.images.standard_resolution.url" alt="instagram image" />
15
- <div class="instaItem__info">
16
- <div class="instaItem__info--wrapper">
17
- <div class="instaItem__info--item"><b-icon icon="heart" /> {{ props.feed.likes.count }}</div>
18
- <div class="instaItem__info--item"><b-icon icon="comments" /> {{ props.feed.comments.count }}</div>
19
- </div>
20
- <div class="instaItem__info--caption">{{ props.feed.caption.text.slice(0, 100) + '...' }}</div>
21
- </div>
22
- </div>
23
- </a>
24
- </template>
25
- </VueInstagram>
26
- </div>
27
- </template>
28
-
29
- <script>
30
- import VueInstagram from 'vue-instagram'
31
-
32
- export default {
33
- name: 'Instagram',
34
- props: {
35
- token: {
36
- type: String,
37
- required: true
38
- }
39
- },
40
- components: { VueInstagram },
41
- data() {
42
- return {
43
- count: 5,
44
- title: 'Join our community',
45
- hasContainer: false
46
- }
47
- }
48
- }
49
- </script>
@@ -1,41 +0,0 @@
1
- <template>
2
- <div class="product-image-modal-container columns">
3
- <div class="main-image-container column is-three-quarters">
4
- <img class="main-image" :src="img" alt="">
5
- </div>
6
-
7
- <div class="column additional-images-container" v-for="image in images" :key="image.id">
8
- <div class="additional-image">
9
- <div class="image-name">
10
- <p>{{image.name}}</p>
11
- </div>
12
- <div>
13
- <img @click="showSelectedImage" class="thumbnails" :src="image.url" alt="">
14
- </div>
15
- </div>
16
- </div>
17
- </div>
18
- </template>
19
-
20
- <script>
21
- export default {
22
- name:'ProductImageModal',
23
- props:{
24
- img: {
25
- type: String,
26
- required: true
27
- },
28
- showSelectedImage: {
29
- type: Function
30
- }
31
- },
32
- data() {
33
- return {
34
- images:''
35
- }
36
- },
37
- mounted() {
38
- this.images = window.wkl_product.images
39
- }
40
- }
41
- </script>
package/jest.config.js DELETED
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- preset: '@vue/cli-plugin-unit-jest',
3
- testMatch: [
4
- '**/*.spec.[jt]s?(x)'
5
- ],
6
- modulePathIgnorePatterns: ["<rootDir>/test/"],
7
- moduleNameMapper: {
8
- '@/(.*)': '<rootDir>/$1'
9
- },
10
- collectCoverage: true,
11
- coverageReporters: ['html', 'text-summary'],
12
- setupFilesAfterEnv: ['<rootDir>/tests/vueBuefy.js'],
13
- transformIgnorePatterns: [
14
- "!node_modules/"
15
- ]
16
- }
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- env: {
3
- test: {
4
- plugins: ['transform-es2015-modules-commonjs'],
5
- sourceType: 'unambiguous'
6
- }
7
- }
8
- }
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- env: {
3
- jest: true
4
- },
5
- globals: {
6
- page: true,
7
- browser: true,
8
- context: true,
9
- jestPuppeteer: true
10
- }
11
- }