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