parent
4e65418c51
commit
2c5b0feeb1
5 changed files with 13 additions and 10 deletions
|
@ -190,13 +190,17 @@ export function createTypeProduct({
|
||||||
slug = name,
|
slug = name,
|
||||||
shippable = true
|
shippable = true
|
||||||
}) {
|
}) {
|
||||||
|
const variantAttributesLine = getValueWithDefault(
|
||||||
|
hasVariants,
|
||||||
|
`variantAttributes: "${attributeId}"`
|
||||||
|
);
|
||||||
const mutation = `mutation{
|
const mutation = `mutation{
|
||||||
productTypeCreate(input: {
|
productTypeCreate(input: {
|
||||||
name: "${name}"
|
name: "${name}"
|
||||||
slug: "${slug}"
|
slug: "${slug}"
|
||||||
productAttributes: "${attributeId}"
|
productAttributes: "${attributeId}"
|
||||||
variantAttributes: "${attributeId}"
|
|
||||||
hasVariants: ${hasVariants}
|
hasVariants: ${hasVariants}
|
||||||
|
${variantAttributesLine}
|
||||||
isShippingRequired:${shippable}
|
isShippingRequired:${shippable}
|
||||||
}){
|
}){
|
||||||
productErrors{
|
productErrors{
|
||||||
|
|
|
@ -2,5 +2,6 @@ export const ASSIGN_PRODUCTS_SELECTORS = {
|
||||||
searchInput: "[name='query']",
|
searchInput: "[name='query']",
|
||||||
tableRow: "[class*='MuiTableRow']",
|
tableRow: "[class*='MuiTableRow']",
|
||||||
checkbox: "[type='checkbox']",
|
checkbox: "[type='checkbox']",
|
||||||
submitButton: "[type='submit']"
|
submitButton: "[type='submit']",
|
||||||
|
dialogContent: '[data-test-id="searchQuery"]'
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,12 +17,9 @@ export function variantsShouldBeVisible({ name, price }) {
|
||||||
export function createFirstVariant({ sku, warehouseId, price, attribute }) {
|
export function createFirstVariant({ sku, warehouseId, price, attribute }) {
|
||||||
cy.get(PRODUCT_DETAILS.addVariantsButton).click();
|
cy.get(PRODUCT_DETAILS.addVariantsButton).click();
|
||||||
cy.get(VARIANTS_SELECTORS.valueContainer)
|
cy.get(VARIANTS_SELECTORS.valueContainer)
|
||||||
.contains(attribute)
|
|
||||||
.find(VARIANTS_SELECTORS.attributeCheckbox)
|
|
||||||
.click()
|
.click()
|
||||||
.get(VARIANTS_SELECTORS.valueContainer)
|
.contains(attribute)
|
||||||
.find(BUTTON_SELECTORS.checked)
|
.click()
|
||||||
.should("exist")
|
|
||||||
.get(VARIANTS_SELECTORS.nextButton)
|
.get(VARIANTS_SELECTORS.nextButton)
|
||||||
.click();
|
.click();
|
||||||
fillUpPriceList(price);
|
fillUpPriceList(price);
|
||||||
|
|
|
@ -9,8 +9,9 @@ export function finalizeDraftOrder(name, address) {
|
||||||
.click()
|
.click()
|
||||||
.get(ASSIGN_PRODUCTS_SELECTORS.searchInput)
|
.get(ASSIGN_PRODUCTS_SELECTORS.searchInput)
|
||||||
.type(name)
|
.type(name)
|
||||||
.get(SHARED_ELEMENTS.progressBar)
|
.get(ASSIGN_PRODUCTS_SELECTORS.dialogContent)
|
||||||
.should("not.be.visible");
|
.find(SHARED_ELEMENTS.progressBar)
|
||||||
|
.should("not.exist");
|
||||||
cy.contains(ASSIGN_PRODUCTS_SELECTORS.tableRow, name)
|
cy.contains(ASSIGN_PRODUCTS_SELECTORS.tableRow, name)
|
||||||
.find(ASSIGN_PRODUCTS_SELECTORS.checkbox)
|
.find(ASSIGN_PRODUCTS_SELECTORS.checkbox)
|
||||||
.click()
|
.click()
|
||||||
|
|
|
@ -248,7 +248,7 @@ const OrderProductAddDialog: React.FC<OrderProductAddDialogProps> = props => {
|
||||||
description="dialog header"
|
description="dialog header"
|
||||||
/>
|
/>
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent className={classes.overflow}>
|
<DialogContent className={classes.overflow} data-test-id="searchQuery">
|
||||||
<TextField
|
<TextField
|
||||||
name="query"
|
name="query"
|
||||||
value={query}
|
value={query}
|
||||||
|
|
Loading…
Reference in a new issue