saleor-dashboard/cypress/e2e/configuration/siteSettings.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

/// <reference types="cypress"/>
/// <reference types="../../support"/>
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { urlList } from "../../fixtures/urlList";
import {
getShopInfo,
updateShopAddress,
} from "../../support/api/requests/ShopSettings";
describe("Tests for site settings", () => {
let address;
before(() => {
cy.clearSessionData().loginUserViaRequest();
2021-09-02 10:36:46 +00:00
cy.fixture("addresses").then(({ usAddress, plAddress }) => {
address = usAddress;
updateShopAddress(plAddress);
cy.checkIfDataAreNotNull(address);
});
});
it(
"should change store address",
{ tags: ["@siteSettings", "@allEnv", "@stable"] },
() => {
cy.clearSessionData()
.loginUserViaRequest()
.visit(urlList.siteSettings)
.fillUpBasicAddress(address)
.get(BUTTON_SELECTORS.confirm)
.click()
.confirmationMessageShouldDisappear();
getShopInfo().then(({ companyAddress }) => {
expect(companyAddress.companyName).to.eq(address.companyName);
cy.expectCorrectBasicAddress(companyAddress, address);
});
},
);
});