Add cypress test for deleting a component
This commit is contained in:
parent
043f6c9275
commit
9f838e098f
|
@ -69,4 +69,22 @@ context("Create Components", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("deletes a component", () => {
|
||||||
|
cy.addComponent("Elements", "Paragraph").then(componentId => {
|
||||||
|
cy.get("[data-cy=setting-_instanceName] input")
|
||||||
|
.type(componentId)
|
||||||
|
.blur()
|
||||||
|
cy.get(".ui-nav ul .nav-item.selected .ri-more-line").click({
|
||||||
|
force: true,
|
||||||
|
})
|
||||||
|
cy.get(".dropdown-container")
|
||||||
|
.contains("Delete")
|
||||||
|
.click()
|
||||||
|
cy.get(".modal")
|
||||||
|
.contains("Delete Component")
|
||||||
|
.click()
|
||||||
|
cy.getComponent(componentId).should("not.exist")
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -159,7 +159,9 @@ Cypress.Commands.add("addComponent", (category, component) => {
|
||||||
cy.wait(500)
|
cy.wait(500)
|
||||||
cy.location().then(loc => {
|
cy.location().then(loc => {
|
||||||
const params = loc.pathname.split("/")
|
const params = loc.pathname.split("/")
|
||||||
return cy.wrap(params[params.length - 1])
|
const componentId = params[params.length - 1]
|
||||||
|
cy.getComponent(componentId).should("exist")
|
||||||
|
return cy.wrap(componentId)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue