Fix tests after changes (#1149)

* fix

* fix
This commit is contained in:
Karolina Rakoczy 2021-06-10 10:13:31 +02:00 committed by GitHub
parent 4e65418c51
commit 2c5b0feeb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 10 deletions

View file

@ -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{

View file

@ -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"]'
};

View file

@ -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);

View file

@ -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()

View file

@ -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}