docs: adiciona os data test

This commit is contained in:
Saulo Klein Nery 2023-02-10 15:41:19 -03:00
parent 049d4d119e
commit 9910dfa19b
5 changed files with 123 additions and 26 deletions

View File

@ -64,7 +64,7 @@ const Pix = () => {
}, [productContext?.selectedItem]); }, [productContext?.selectedItem]);
return ( return (
<div className="pix-container"> <div data-testid="pix-price" className="pix-container">
<img <img
className="pix-image" className="pix-image"
src="https://agenciamagma.vteximg.com.br/arquivos/pix-icon-sauloklein-m3academy.svg" src="https://agenciamagma.vteximg.com.br/arquivos/pix-icon-sauloklein-m3academy.svg"
@ -72,13 +72,13 @@ const Pix = () => {
/> />
<div className="price-wrapper"> <div className="price-wrapper">
<span className="price-value"> <p className="price-value">
{(pixValue / 100).toLocaleString("pt-br", { {(pixValue / 100).toLocaleString("pt-br", {
style: "currency", style: "currency",
currency: "BRL", currency: "BRL",
})} })}
</span> </p>
<span className="price-discount">{discountValue}</span> <p className="price-discount">{discountValue}</p>
</div> </div>
</div> </div>
); );

View File

@ -1,10 +1,10 @@
{ {
"store.product": { "store.product": {
"children": [ "children": [
"html#breadcrumb", "html#breadcontainer",
//"example-component", //"example-component",
"condition-layout.product#availability", "condition-layout.product#availability",
"tab-layout", "html#product-description",
//"flex-layout.row#specifications-title", //"flex-layout.row#specifications-title",
//"product-specification-group#table", //"product-specification-group#table",
"flex-layout.row#shelf-row" "flex-layout.row#shelf-row"
@ -33,10 +33,17 @@
}, },
"list-context.product-list": { "list-context.product-list": {
"children": ["slider-layout#shelf-prod"], "children": ["html#slider"],
"blocks": ["product-summary.shelf"] "blocks": ["product-summary.shelf"]
}, },
"html#slider": {
"props": {
"testId": "product-summary-list"
},
"children": ["slider-layout#shelf-prod"]
},
"slider-layout#shelf-prod": { "slider-layout#shelf-prod": {
"props": { "props": {
"itemsPerPage": { "itemsPerPage": {
@ -47,12 +54,11 @@
"infinite": true, "infinite": true,
"showNavigationArrows": "always", "showNavigationArrows": "always",
"showPaginationDots": "always", "showPaginationDots": "always",
"blockClass": "slide-shelf", "blockClass": "slide-shelf"
"colGap": 16
} }
}, },
"html#breadcrumb": { "html#breadcontainer": {
"props": { "props": {
"tag": "section", "tag": "section",
"testId": "breadcrumbs", "testId": "breadcrumbs",
@ -121,8 +127,9 @@
} }
}, },
"flex-layout.row#product-image": { "flex-layout.row#product-image": {
"children": ["product-images"] "children": ["html#imagens"]
}, },
"product-images": { "product-images": {
"props": { "props": {
"aspectRatio": { "aspectRatio": {
@ -136,14 +143,29 @@
} }
}, },
"html#imagens": {
"props": {
"testId": "product-images"
},
"children": ["product-images"]
},
"product-installments": { "product-installments": {
"props": { "props": {
"blockClass": "sellingInfo" "blockClass": "sellingInfo"
} }
}, },
"flex-layout.row#selling-prices": { "html#product-installments": {
"props": { "props": {
"testId": "product-installments"
},
"children": ["product-installments"]
},
"html#selling-price": {
"props": {
"testId": "product-price",
"blockClass": "sellingPrice" "blockClass": "sellingPrice"
}, },
"children": ["product-selling-price"] "children": ["product-selling-price"]
@ -156,28 +178,49 @@
"rowGap": 0 "rowGap": 0
}, },
"children": [ "children": [
"flex-layout.row#product-name", "html#product-name",
"product-identifier.product", "html#codigo",
//"availability-subscriber", //"availability-subscriber",
//"product-assembly-options", //"product-assembly-options",
"product-rating-summary", "product-rating-summary",
//"flex-layout.row#list-price-savings", //"flex-layout.row#list-price-savings",
"flex-layout.row#selling-prices", "html#selling-price",
"product-installments", "html#product-installments",
"pix-component", "html#pixzap",
//"product-separator", //"product-separator",
"sku-selector", "html#sku-selector",
//"product-quantity",
//"product-gifts", //"product-gifts",
"flex-layout.row#buy-button", "flex-layout.row#buy-button",
"shipping-simulator", "html#shipping-simulator",
"placeholder-component" "placeholder-component"
//"share#default" //"share#default"
] ]
}, },
"flex-layout.row#product-name": { "html#shipping-simulator": {
"props": { "props": {
"testId": "shipping-simulator"
},
"children": ["shipping-simulator"]
},
"html#pixzap": {
"props": {
"testId": "pix-price"
},
"children": ["pix-component"]
},
"html#codigo": {
"props": {
"testId": "product-code"
},
"children": ["product-identifier.product"]
},
"html#product-name": {
"props": {
"testId": "product-name",
"marginBottom": 3, "marginBottom": 3,
"blockClass": "productName" "blockClass": "productName"
}, },
@ -192,6 +235,13 @@
} }
}, },
"html#sku-selector": {
"props": {
"testId": "sku-selector"
},
"children": ["sku-selector"]
},
"product-quantity": { "product-quantity": {
"props": { "props": {
"size": "large", "size": "large",
@ -199,22 +249,36 @@
} }
}, },
"html#product-quantity": {
"props": {
"testId": "product-quantity"
},
"children": ["product-quantity"]
},
"flex-layout.row#buy-button": { "flex-layout.row#buy-button": {
"props": { "props": {
"marginTop": 4, "marginTop": 4,
"marginBottom": 7, "marginBottom": 7,
"blockClass": "quantityAndBuy" "blockClass": "quantityAndBuy"
}, },
"children": ["product-quantity", "add-to-cart-button"] "children": ["html#product-quantity", "html#add-to-cart-button"]
}, },
"add-to-cart-button": { "add-to-cart-button#addSacola": {
"props": { "props": {
"blockClass": "addToCartButton", "blockClass": "addToCartButton",
"text": "ADICIONAR À SACOLA" "text": "ADICIONAR À SACOLA"
} }
}, },
"html#add-to-cart-button": {
"props": {
"testId": "add-to-cart-button"
},
"children": ["add-to-cart-button#addSacola"]
},
"flex-layout.row#product-availability": { "flex-layout.row#product-availability": {
"props": { "props": {
"blockClass": "productPanel" "blockClass": "productPanel"
@ -231,10 +295,10 @@
"blockClass": "info-availability" "blockClass": "info-availability"
}, },
"children": [ "children": [
"flex-layout.row#product-name", "html#product-name",
"product-identifier.product", "html#codigo",
"flex-layout.row#availability", "flex-layout.row#availability",
"sku-selector" "html#sku-selector"
] ]
}, },
"flex-layout.row#availability": { "flex-layout.row#availability": {
@ -330,6 +394,13 @@
} }
}, },
"html#product-description": {
"props": {
"testId": "product-description"
},
"children": ["tab-layout"]
},
"tab-content.item#1": { "tab-content.item#1": {
"children": ["product-images#2", "product-description"], "children": ["product-images#2", "product-description"],
"props": { "props": {

View File

@ -1,5 +1,12 @@
{ {
"product-summary.shelf": { "product-summary.shelf": {
"children": ["html#prateleira"]
},
"html#prateleira": {
"props": {
"testId": "vtex-product-summary"
},
"children": [ "children": [
"stack-layout#prodsum", "stack-layout#prodsum",
"product-summary-name", "product-summary-name",
@ -12,6 +19,7 @@
//"add-to-cart-button" //"add-to-cart-button"
] ]
}, },
"flex-layout.col#productRating": { "flex-layout.col#productRating": {
"props": { "props": {
"blockClass": "productRating" "blockClass": "productRating"

View File

@ -12,6 +12,16 @@
justify-content: center; justify-content: center;
margin: 0 0 32px; margin: 0 0 32px;
} }
@media only screen and (max-width: 1024px) {
.container--shelf-title {
margin: 0 0 24px;
}
}
@media only screen and (max-width: 767px) {
.container--shelf-title {
margin: 0 0 16px;
}
}
.container--shelf-title .headingLevel3 { .container--shelf-title .headingLevel3 {
font-weight: 400; font-weight: 400;
font-size: 20px; font-size: 20px;

View File

@ -2,6 +2,14 @@
justify-content: center; justify-content: center;
margin: 0 0 32px; margin: 0 0 32px;
@include mq(lg, max) {
margin: 0 0 24px;
}
@include mq(md, max) {
margin: 0 0 16px;
}
.headingLevel3 { .headingLevel3 {
font-weight: 400; font-weight: 400;
font-size: 20px; font-size: 20px;