Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit baab268

Browse files
committed
Merge branch 'develop' of https://github.com/DivanteLtd/vue-storefront into develop
2 parents 9df2b68 + 6564e41 commit baab268

File tree

15 files changed

+290
-256
lines changed

15 files changed

+290
-256
lines changed

core/components/blocks/MyAccount/MyOrder.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ export default {
33
data () {
44
return {
55
ordersHistory: [],
6-
order: {},
6+
order: {
7+
items: []
8+
},
79
paymentMethod: '',
810
shippingAddress: {
911
'firstname': '',
@@ -78,6 +80,11 @@ export default {
7880
'city': addressObject.city,
7981
'country': addressObject.country_id
8082
}
83+
},
84+
skipGrouped (items) {
85+
return items.filter((item) => {
86+
return !item.parent_item_id
87+
})
8188
}
8289
}
8390
}

core/components/blocks/MyAccount/MyOrders.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ export default {
3434
this.$store.dispatch('cart/addItem', { productToAdd: product }).then(() => { })
3535
})
3636
})
37+
},
38+
skipGrouped (items) {
39+
return items.filter((item) => {
40+
return !item.parent_item_id
41+
})
3742
}
3843
}
3944
}

core/filters/price/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { currentStoreView } from '@vue-storefront/store/lib/multistore'
55
* @param {Number} value
66
*/
77
export function price (value) {
8+
if (isNaN(value)) {
9+
return value
10+
}
811
const formattedVal = parseFloat(value).toFixed(2)
912
const storeView = currentStoreView()
1013
if (value >= 0) {

cypress/integration/add-to-cart.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ describe('add to cart', () => {
1414
'Product has been added to the cart!'
1515
)
1616
cy.get('header [aria-label="Open microcart"]').click({ force: true })
17-
cy.get('div.microcart ul li:nth-child(1) .sku').should('contain', 'WS01-L-Green')
17+
cy.get('div.microcart ul li:nth-child(1) .sku').should(
18+
'contain',
19+
'WS01-L-Green'
20+
)
1821
cy.get('div.microcart button.close').click()
1922
})
2023

@@ -33,7 +36,10 @@ describe('add to cart', () => {
3336
'Product has been added to the cart!'
3437
)
3538
cy.get('header [aria-label="Open microcart"]').click({ force: true })
36-
cy.get('div.microcart ul li:nth-child(1) .price-regular').should('contain', '163.59')
39+
cy.get('div.microcart ul li:nth-child(1) .price-regular').should(
40+
'contain',
41+
'163.59'
42+
)
3743
cy.get('div.microcart button.close').click()
3844
})
3945
})
Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1-
describe("basic client path", () => {
2-
it("should go through basic user flow", () => {
3-
cy.visit("/");
4-
cy.get(".modal-close").click();
5-
indexedDB.deleteDatabase("shop");
6-
cy.clearLocalStorage();
7-
cy.get(".product-link").eq(6).click({ force: true });
8-
cy.get("[data-testid=addToCart]").click();
9-
cy.get("[data-testid=notificationAction2]").click();
10-
cy.get("[name=first-name]").type("Firstname");
11-
cy.get("[name=last-name]").type("Lastname");
12-
cy.get("[name=email-address]").type("[email protected]");
13-
cy.get("[data-testid=personalDetailsSubmit]").click();
14-
cy.get("[name=street-address]").type("Streetname");
15-
cy.get("[name=apartment-number]").type("28");
16-
cy.get("[name=city]").type("Wroclaw");
17-
cy.get("[name=state]").type("Lowersilesian");
18-
cy.get("[name=zip-code").type("50-000");
19-
cy.get("[name=countries]").select("PL");
20-
cy.get("[name=phone-number]").type("111 222 333");
21-
cy.get("[data-testid=shippingSubmit]").click();
22-
cy.get("#sendToShippingAddressCheckbox").check({ force: true });
23-
cy.get("[data-testid=paymentSubmit]").click();
24-
cy.get("#acceptTermsCheckbox").check({ force: true });
25-
cy.get('[data-testid=orderReviewSubmit]').should('not.have.class', 'button-disabled')
26-
});
27-
});
1+
describe('basic client path', () => {
2+
it('should go through basic user flow', () => {
3+
cy.visit('/')
4+
cy.setCookie('shop/claims/onboardingAccepted', 'test')
5+
indexedDB.deleteDatabase('shop')
6+
cy.clearLocalStorage()
7+
cy.reload()
8+
cy.get(':nth-child(6) > .product > .no-underline > .product-image > img')
9+
.first()
10+
.click({ force: true })
11+
cy.get('[data-testid=addToCart]').click()
12+
cy.get('[data-testid=notificationAction2]').click()
13+
cy.get('[name=first-name]').type('Firstname', { force: true })
14+
cy.get('[name=last-name]').type('Lastname', { force: true })
15+
cy.get('[name=email-address]').type('[email protected]', {
16+
force: true
17+
})
18+
cy.get('[data-testid=personalDetailsSubmit]').click({ force: true })
19+
cy.get('[name=street-address]').type('Streetname', { force: true })
20+
cy.get('[name=apartment-number]').type('28', { force: true })
21+
cy.get('[name=city]').type('Wroclaw', { force: true })
22+
cy.get('[name=state]').type('Lowersilesian', { force: true })
23+
cy.get('[name=zip-code').type('50-000', { force: true })
24+
cy.get('[name=countries]').select('PL', { force: true })
25+
cy.get('[name=phone-number]').type('111 222 333', { force: true })
26+
cy.get('[data-testid=shippingSubmit]').click({ force: true })
27+
cy.get('#sendToShippingAddressCheckbox').check({ force: true })
28+
cy.get('[data-testid=paymentSubmit]').click({ force: true })
29+
cy.get('#acceptTermsCheckbox').check({ force: true })
30+
cy.get('[data-testid=orderReviewSubmit]').click({ force: true })
31+
cy.get('.category-title').should('contain', 'Order confirmation')
32+
})
33+
})

cypress/integration/category-page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
describe('Category page', () => {
33
it('verification of filters in the Women category', () => {
44
cy.visit('/')
5-
cy.get('.modal-close').click()
5+
cy.setCookie('shop/claims/onboardingAccepted', 'test')
66
indexedDB.deleteDatabase('shop')
77
cy.clearLocalStorage()
88
cy.get('[aria-label="Open menu"]').click()

cypress/integration/checkout-page.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
describe("checkout page", () => {
2-
it("Default shipping/billing address should be changed", () => {
3-
cy.visit("/");
4-
cy.get(".modal-close").click();
5-
indexedDB.deleteDatabase("shop");
6-
cy.clearLocalStorage();
7-
cy.get(".header button")
1+
describe('checkout page', () => {
2+
it('Default shipping/billing address should be changed', () => {
3+
cy.visit('/')
4+
cy.setCookie('shop/claims/onboardingAccepted', 'test')
5+
indexedDB.deleteDatabase('shop')
6+
cy.clearLocalStorage()
7+
cy.get('.header button')
88
.last()
9-
.click();
10-
cy.get("[name=email]").type("[email protected]");
11-
cy.get("[name=password]").type("123qwe!@#");
12-
cy.get("#remember").check({ force: true });
13-
cy.get(".button-full").click();
14-
cy.get(".col-xs-4 > div").click();
9+
.click()
10+
cy.get('[name=email]').type('[email protected]')
11+
cy.get('[name=password]').type('123qwe!@#')
12+
cy.get('#remember').check({ force: true })
13+
cy.get('.button-full').click()
14+
cy.get('.col-xs-4 > div').click()
1515
cy.get(
16-
".VueCarousel-inner > :nth-child(3) > .product > .no-underline > .product-image > img"
17-
).click({ force: true });
18-
cy.get("[data-testid=addToCart]").click();
19-
cy.get("[data-testid=notificationAction2]").click();
20-
cy.get("[data-testid=personalDetailsSubmit]").click({ force: true });
21-
cy.get("#shipToMyAddressCheckbox").check({ force: true });
22-
cy.get("[name=street-address]")
16+
'.VueCarousel-inner > :nth-child(3) > .product > .no-underline > .product-image > img'
17+
).click({ force: true })
18+
cy.get('[data-testid=addToCart]').click()
19+
cy.get('[data-testid=notificationAction2]').click()
20+
cy.get('[data-testid=personalDetailsSubmit]').click({ force: true })
21+
cy.get('#shipToMyAddressCheckbox').check({ force: true })
22+
cy.get('[name=street-address]')
2323
.clear()
24-
.type("Dmowskiego street", { force: true });
25-
cy.get("[name=apartment-number]")
24+
.type('Dmowskiego street', { force: true })
25+
cy.get('[name=apartment-number]')
2626
.clear()
27-
.type("17", { force: true });
28-
cy.get("[name=city]")
27+
.type('17', { force: true })
28+
cy.get('[name=city]')
2929
.clear()
30-
.type("Wroclaw", { force: true });
31-
cy.get("[data-testid=shippingSubmit]").click({ force: true });
32-
cy.get(":nth-child(2) > .col-sm-9 > .row > .h4").should(
33-
"contain",
34-
"Wroclaw"
35-
);
36-
cy.get("#sendToShippingAddressCheckbox").check({ force: true });
37-
cy.get("[value=checkmo]")
30+
.type('Wroclaw', { force: true })
31+
cy.get('[data-testid=shippingSubmit]').click({ force: true })
32+
cy.get(':nth-child(2) > .col-sm-9 > .row > .h4').should(
33+
'contain',
34+
'Wroclaw'
35+
)
36+
cy.get('#sendToShippingAddressCheckbox').check({ force: true })
37+
cy.get('[value=checkmo]')
3838
.check()
39-
.should("be.checked");
40-
cy.get("[data-testid=paymentSubmit]").click({ force: true });
41-
cy.get("#acceptTermsCheckbox").check({ force: true });
42-
cy.get("[data-testid=orderReviewSubmit]").click({ force: true });
43-
cy.get(".category-title").should("contain", "Order confirmation");
44-
});
45-
});
39+
.should('be.checked')
40+
cy.get('[data-testid=paymentSubmit]').click({ force: true })
41+
cy.get('#acceptTermsCheckbox').check({ force: true })
42+
cy.get('[data-testid=orderReviewSubmit]').click({ force: true })
43+
cy.get('.category-title').should('contain', 'Order confirmation')
44+
})
45+
})

cypress/integration/home-page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
describe('home page', () => {
33
it('verify the content of the homepage', () => {
44
cy.visit('/')
5-
cy.get('.modal-close').click()
5+
cy.setCookie('shop/claims/onboardingAccepted', 'test')
66
indexedDB.deleteDatabase('shop')
77
cy.clearLocalStorage()
88
cy.get('.VueCarousel-inner .VueCarousel-slide:first-of-type h1').should(
@@ -17,7 +17,7 @@ describe('home page', () => {
1717
cy.get('.VueCarousel-dot-container li:nth-of-type(3)').click()
1818
cy.get(
1919
'.VueCarousel-inner .VueCarousel-slide:nth-of-type(3) .subtitle'
20-
).should('contain', 'What\'s new')
20+
).should('contain', "What's new")
2121
cy.get('.material-icons.icon').click()
2222
cy.get('.pl0').should('be.visible')
2323
cy.get('.newsletter-button > .button-outline')

cypress/integration/local-storage.js

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
1-
describe("local-storage", () => {
2-
it("Items added to the cart should be kept.", () => {
3-
cy.visit("p/WS11/diva-gym-tee-1545/WS11");
4-
indexedDB.deleteDatabase("shop");
5-
indexedDB.deleteDatabase("carts");
6-
cy.clearLocalStorage();
1+
describe('local-storage', () => {
2+
it('Items added to the cart should be kept.', () => {
3+
cy.visit('p/WS11/diva-gym-tee-1545/WS11')
4+
indexedDB.deleteDatabase('shop')
5+
indexedDB.deleteDatabase('carts')
6+
cy.clearLocalStorage()
77
cy.get('.color[aria-label="Select color Yellow"]')
88
.click()
9-
.should("have.class", "active");
10-
cy.get('[aria-label="Select size S"]').click();
11-
cy.get(":nth-child(2) > .variants-label > .weight-700").should(
12-
"contain",
13-
"S"
14-
);
15-
cy.get("[data-testid=addToCart]").click();
16-
cy.get("[data-testid=notificationMessage]").should(
17-
"contain",
18-
"Product has been added to the cart!"
19-
);
20-
cy.get('header [aria-label="Open microcart"]').click({ force: true });
21-
cy.get(".microcart").should("have.class", "active");
22-
cy.reload();
23-
cy.get('header [aria-label="Open microcart"]').click({ force: true });
24-
cy.get(".sku").should("contain", "WS11-S-Yellow");
25-
cy.get(":nth-child(1) > .middle-xs > .hidden-xs").click();
26-
cy.get(".details .cl-accent .weight-700.hidden")
9+
.should('have.class', 'active')
10+
cy.get('[aria-label="Select size S"]').click()
11+
cy.get(':nth-child(2) > .variants-label > .weight-700').should(
12+
'contain',
13+
'S'
14+
)
15+
cy.get('[data-testid=addToCart]').click()
16+
cy.get('[data-testid=notificationMessage]').should(
17+
'contain',
18+
'Product has been added to the cart!'
19+
)
20+
cy.get('header [aria-label="Open microcart"]').click({ force: true })
21+
cy.get('.microcart').should('have.class', 'active')
22+
cy.reload()
23+
cy.get('header [aria-label="Open microcart"]').click({ force: true })
24+
cy.get('.sku').should('contain', 'WS11-S-Yellow')
25+
cy.get(':nth-child(1) > .middle-xs > .hidden-xs').click()
26+
cy.get('.details .cl-accent .weight-700.hidden')
2727
.click({ force: true })
28-
.should("contain", "1");
29-
cy.get("input.h6")
28+
.should('contain', '1')
29+
cy.get('input.h6')
3030
.click()
3131
.clear()
32-
.type("2")
33-
.blur();
34-
cy.reload();
35-
cy.get('header [aria-label="Open microcart"]').click({ force: true });
36-
cy.get(".col-xs > .h5 > .weight-700").should("contain", "2");
37-
cy.get("div.microcart button.close").click();
38-
cy.get(".minicart-count").should("contain", "2");
39-
});
40-
});
32+
.type('2')
33+
.blur()
34+
cy.get('.cl-success').click()
35+
cy.reload()
36+
cy.get('header [aria-label="Open microcart"]').click({ force: true })
37+
cy.get('.col-xs > .h5 > .weight-700').should('contain', '2')
38+
cy.get('div.microcart button.close').click()
39+
cy.get('.minicart-count').should('contain', '2')
40+
})
41+
})

cypress/integration/login-path.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
describe('login path', () => {
22
it('should login user', () => {
3-
cy.visit('/');
4-
cy.get('.modal-close').click();
5-
indexedDB.deleteDatabase('shop');
6-
cy.clearLocalStorage();
7-
cy.get('.header button').last().click();
8-
cy.get('[name=email]').type('[email protected]');
9-
cy.get('[name=password]').type('Password123');
10-
cy.get('#remember').check({ force: true });
11-
cy.get(".modal .cl-error").should('be.not.be.visible');
12-
});
13-
});
3+
cy.visit('/')
4+
cy.setCookie('shop/claims/onboardingAccepted', 'test')
5+
indexedDB.deleteDatabase('shop')
6+
cy.clearLocalStorage()
7+
cy.setCookie('shop/claims/onboardingAccepted', 'test')
8+
cy.get('.header button')
9+
.last()
10+
.click({ force: true })
11+
cy.get('[name=email]').type('[email protected]', { force: true })
12+
cy.get('[name=password]').type('Password123', { force: true })
13+
cy.get('#remember').check({ force: true })
14+
cy.get('.modal .cl-error').should('be.not.be.visible')
15+
})
16+
})

0 commit comments

Comments
 (0)