remove adding sku to simple product (#2467)
This commit is contained in:
parent
d3e2be165d
commit
d9a1916fd0
1 changed files with 1 additions and 92 deletions
|
@ -3,14 +3,10 @@
|
|||
|
||||
import faker from "faker";
|
||||
|
||||
import { PRODUCT_DETAILS } from "../../../elements/catalog/products/product-details";
|
||||
import { VARIANTS_SELECTORS } from "../../../elements/catalog/products/variants-selectors";
|
||||
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
||||
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
|
||||
import {
|
||||
productDetailsUrl,
|
||||
productVariantDetailUrl,
|
||||
} from "../../../fixtures/urlList";
|
||||
import { productVariantDetailUrl } from "../../../fixtures/urlList";
|
||||
import {
|
||||
createVariant,
|
||||
getVariant,
|
||||
|
@ -114,49 +110,6 @@ describe("Updating products without sku", () => {
|
|||
cy.clearSessionData().loginUserViaRequest();
|
||||
});
|
||||
|
||||
it(
|
||||
"should add sku to simple product",
|
||||
{ tags: ["@products", "@allEnv", "@stable"] },
|
||||
() => {
|
||||
const sku = "NewSkuSimpleProd";
|
||||
const simpleProductName = `${startsWith}${faker.datatype.number()}`;
|
||||
let simpleProduct;
|
||||
createProductInChannelWithoutVariants({
|
||||
name: simpleProductName,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
channelId: defaultChannel.id,
|
||||
productTypeId: productTypeWithoutVariants.id,
|
||||
})
|
||||
.then(productResp => {
|
||||
simpleProduct = productResp;
|
||||
createVariant({
|
||||
productId: simpleProduct.id,
|
||||
channelId: defaultChannel.id,
|
||||
warehouseId: warehouse.id,
|
||||
quantityInWarehouse: 10,
|
||||
});
|
||||
})
|
||||
.then(variantsList => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productDetailsUrl(simpleProduct.id),
|
||||
)
|
||||
.get(SHARED_ELEMENTS.skeleton)
|
||||
.should("not.exist")
|
||||
.get(PRODUCT_DETAILS.skuInput)
|
||||
.type(sku)
|
||||
.addAliasToGraphRequest("SimpleProductUpdate")
|
||||
.get(BUTTON_SELECTORS.confirm)
|
||||
.click()
|
||||
.waitForRequestAndCheckIfNoErrors("@SimpleProductUpdate");
|
||||
getVariant(variantsList[0].id, defaultChannel.slug);
|
||||
})
|
||||
.then(variantResp => {
|
||||
expect(variantResp.sku).to.eq(sku);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
"should add sku to variant",
|
||||
{ tags: ["@products", "@allEnv", "@stable"] },
|
||||
|
@ -228,50 +181,6 @@ describe("Updating products without sku", () => {
|
|||
},
|
||||
);
|
||||
|
||||
it(
|
||||
"should remove sku from simple product",
|
||||
{ tags: ["@products", "@allEnv", "@stable"] },
|
||||
() => {
|
||||
const simpleProductName = `${startsWith}${faker.datatype.number()}`;
|
||||
let simpleProduct;
|
||||
createProductInChannelWithoutVariants({
|
||||
name: simpleProductName,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
channelId: defaultChannel.id,
|
||||
productTypeId: productTypeWithoutVariants.id,
|
||||
})
|
||||
.then(productResp => {
|
||||
simpleProduct = productResp;
|
||||
createVariant({
|
||||
productId: simpleProduct.id,
|
||||
channelId: defaultChannel.id,
|
||||
sku: simpleProductName,
|
||||
quantityInWarehouse: 10,
|
||||
warehouseId: warehouse.id,
|
||||
});
|
||||
})
|
||||
.then(variantsList => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productDetailsUrl(simpleProduct.id),
|
||||
)
|
||||
.get(SHARED_ELEMENTS.skeleton)
|
||||
.should("not.exist")
|
||||
.get(PRODUCT_DETAILS.skuInput)
|
||||
.clear()
|
||||
.addAliasToGraphRequest("SimpleProductUpdate")
|
||||
.get(BUTTON_SELECTORS.confirm)
|
||||
.click()
|
||||
.waitForRequestAndCheckIfNoErrors("@SimpleProductUpdate");
|
||||
getVariant(variantsList[0].id, defaultChannel.slug);
|
||||
})
|
||||
.then(variantResp => {
|
||||
expect(variantResp.sku).to.be.null;
|
||||
checkIfCheckoutForVariantCanBeCompleted(variantResp);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
function checkIfCheckoutForVariantCanBeCompleted(variant) {
|
||||
createWaitingForCaptureOrder({
|
||||
address,
|
||||
|
|
Loading…
Reference in a new issue