Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Merge 6d03241 into 467e319
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofwolski authored Sep 28, 2020
2 parents 467e319 + 6d03241 commit a6a6409
Show file tree
Hide file tree
Showing 54 changed files with 1,142 additions and 876 deletions.
16 changes: 0 additions & 16 deletions .plop/exampleGenerator.js

This file was deleted.

24 changes: 0 additions & 24 deletions .plop/index.js

This file was deleted.

96 changes: 0 additions & 96 deletions .plop/reactComponent.js

This file was deleted.

1 change: 0 additions & 1 deletion .plop/templates/exportAll.ts.hbs

This file was deleted.

22 changes: 0 additions & 22 deletions .plop/templates/reactComponent.tsx.hbs

This file was deleted.

1 change: 0 additions & 1 deletion .plop/templates/reactComponentIndex.ts.hbs

This file was deleted.

9 changes: 0 additions & 9 deletions .plop/templates/reactComponentStory.tsx.hbs

This file was deleted.

3 changes: 0 additions & 3 deletions .plop/templates/reactComponentStyles.ts.hbs

This file was deleted.

15 changes: 0 additions & 15 deletions .plop/templates/reactComponentTest.tsx.hbs

This file was deleted.

1 change: 0 additions & 1 deletion .plop/templates/reactComponentTypes.ts.hbs

This file was deleted.

44 changes: 0 additions & 44 deletions .plop/utils.js

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Require payment recreate when payment price is wrong - #892 by @orzechdev
- Handle JWT token refreshing and verifying - #883 by @orzechdev
- Fix cart sidebar style - #897 by @orzechdev
- Refactor variant picker components and open sidebar after adding product to cart - #809 by @krzysztofwolski
- Fix checkout address view - #909 by @konstantinoschristomanos

## 2.10.4
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ Cypress UI mode:
test:e2e:dev
```

## Creating new components

All new components should follow Atomic Design Guidelines and be placed in `src/@next/components` directory.

Files structure can be generated using `plop`:

```
npm run generate
```

## Modifying the Storefront

[From Spectrum Post](https://spectrum.chat/saleor/saleor-storefront/modifying-the-storefront~c1955dbf-a421-4fb6-b99e-937dd2642b23)
Expand Down
2 changes: 2 additions & 0 deletions cypress/elements/cart/cart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const CART_SELECTORS = {
deleteItemBtn: '[data-test="removeButton"]',
continueShoppingBtn: '[data-test="cartPageContinueShoppingButton"]',
cartSidebar: '[data-test="cartOverlay"]',
cartSidebarRow: '[data-test="cartRow"]',
};
8 changes: 4 additions & 4 deletions cypress/elements/products/products-selectors.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export const PRODUCTS_SELECTORS = {
product_list: ".product-list-item",
first_selected_product_name: ".product-description >h3",
variantPicker: ".product-description__variant-picker",
attributOptions: "[data-test='attributeOption']",
first_selected_product_name: "[data-test='productName']",
variantPicker: "[data-test='variantPicker']",
attributeOptions: "[data-test='attributeOption']",
addToBasketBtn: "[data-test=addProductToCartButton]",
cartQuantity: ".main-menu__cart__quantity",
goToBagMyBagBtn: "[data-test='gotoBagViewButton']",
procceedToCheckoutBtn: "[data-test=proceedToCheckoutButton]",
proceedToCheckoutBtn: "[data-test=proceedToCheckoutButton]",
};
8 changes: 4 additions & 4 deletions cypress/integration/products/buy_a_product.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("Buy a product", () => {
.visit("/")
.clearCart()
.addItemWithShippingToTheBasket()
.get(PRODUCTS_SELECTORS.procceedToCheckoutBtn)
.get(PRODUCTS_SELECTORS.proceedToCheckoutBtn)
.click()
.get(CHECKOUT_SELECTORS.CHECKOUT_LINKS.address)
.click()
Expand Down Expand Up @@ -76,7 +76,7 @@ describe("Buy a product", () => {
cy.visit("/")
.clearCart()
.addItemWithShippingToTheBasket()
.get(PRODUCTS_SELECTORS.procceedToCheckoutBtn)
.get(PRODUCTS_SELECTORS.proceedToCheckoutBtn)
.click()
.get(CHECKOUT_SELECTORS.continueAsAGuest)
.click()
Expand Down Expand Up @@ -122,7 +122,7 @@ describe("Buy a product", () => {
.visit("/")
.clearCart()
.addItemWithNoShippingToTheBasket()
.get(PRODUCTS_SELECTORS.procceedToCheckoutBtn)
.get(PRODUCTS_SELECTORS.proceedToCheckoutBtn)
.click()
.get(CHECKOUT_SELECTORS.CHECKOUT_LINKS.address)
.click()
Expand Down Expand Up @@ -164,7 +164,7 @@ describe("Buy a product", () => {
cy.visit("/")
.clearCart()
.addItemWithNoShippingToTheBasket()
.get(PRODUCTS_SELECTORS.procceedToCheckoutBtn)
.get(PRODUCTS_SELECTORS.proceedToCheckoutBtn)
.click()
.get(CHECKOUT_SELECTORS.continueAsAGuest)
.click()
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/products/order-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("Buy a product and check the order history", () => {
.get("@productName")
.then(productName => {
return cy
.get(PRODUCTS_SELECTORS.procceedToCheckoutBtn)
.get(PRODUCTS_SELECTORS.proceedToCheckoutBtn)
.click()
.get(CHECKOUT_SELECTORS.CHECKOUT_LINKS.address)
.click()
Expand Down
15 changes: 9 additions & 6 deletions cypress/support/product/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { PRODUCTS_SELECTORS } from "../../elements/products/products-selectors";
import { HEADER_SELECTORS } from "../../elements/main-header/header-selectors";
import { SEARCH_PRODUCTS_SELECTORS_RIGHT_MENU } from "../../elements/products/search-products-selectors";
import { CART_SELECTORS } from "../../elements/cart/cart";

Cypress.Commands.add("addItemWithShippingToTheBasket", () => {
return cy
Expand All @@ -14,14 +15,15 @@ Cypress.Commands.add("addItemWithShippingToTheBasket", () => {
.as("productName")
.get(PRODUCTS_SELECTORS.variantPicker)
.click()
.get(PRODUCTS_SELECTORS.attributOptions)
.get(PRODUCTS_SELECTORS.attributeOptions)
.first()
.click()
.get(PRODUCTS_SELECTORS.addToBasketBtn)
.click()
.get(PRODUCTS_SELECTORS.cartQuantity)
.get(CART_SELECTORS.cartSidebar)
.should("be.visible")
.get(CART_SELECTORS.cartSidebarRow)
.should("be.visible")
.click()
.get(PRODUCTS_SELECTORS.goToBagMyBagBtn)
.click();
});
Expand All @@ -40,14 +42,15 @@ Cypress.Commands.add("addItemWithNoShippingToTheBasket", () => {
.click()
.get(PRODUCTS_SELECTORS.variantPicker)
.click()
.get(PRODUCTS_SELECTORS.attributOptions)
.get(PRODUCTS_SELECTORS.attributeOptions)
.first()
.click()
.get(PRODUCTS_SELECTORS.addToBasketBtn)
.click()
.get(PRODUCTS_SELECTORS.cartQuantity)
.get(CART_SELECTORS.cartSidebar)
.should("be.visible")
.get(CART_SELECTORS.cartSidebarRow)
.should("be.visible")
.click()
.get(PRODUCTS_SELECTORS.goToBagMyBagBtn)
.click();
});
Loading

0 comments on commit a6a6409

Please sign in to comment.