Updating binding tests.
This commit is contained in:
parent
923599df70
commit
e2c9c06f98
|
@ -36,7 +36,9 @@ context("Create Bindings", () => {
|
||||||
it("should add a binding with a handlebars helper", () => {
|
it("should add a binding with a handlebars helper", () => {
|
||||||
cy.addComponent("Elements", "Paragraph").then(componentId => {
|
cy.addComponent("Elements", "Paragraph").then(componentId => {
|
||||||
// Cypress needs to escape curly brackets
|
// Cypress needs to escape curly brackets
|
||||||
addSettingBinding("text", "{{}{{} add 1 2 {}}{}}", false)
|
cy.get("[data-cy=setting-text] input")
|
||||||
|
.type("{{}{{} add 1 2 {}}{}}")
|
||||||
|
.blur()
|
||||||
cy.getComponent(componentId).should("have.text", "3")
|
cy.getComponent(componentId).should("have.text", "3")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -51,6 +53,6 @@ const addSettingBinding = (setting, bindingText, clickOption = true) => {
|
||||||
} else {
|
} else {
|
||||||
cy.get("textarea").type(bindingText)
|
cy.get("textarea").type(bindingText)
|
||||||
}
|
}
|
||||||
cy.get("button").click()
|
cy.contains("Save").click()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,17 +150,15 @@ Cypress.Commands.add("getComponent", componentId => {
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("navigateToFrontend", () => {
|
Cypress.Commands.add("navigateToFrontend", () => {
|
||||||
cy.contains("design").click()
|
cy.contains("Design").click()
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createScreen", (screenName, route) => {
|
Cypress.Commands.add("createScreen", (screenName, route) => {
|
||||||
cy.get("[data-cy=new-screen]").click()
|
cy.get("[aria-label=AddCircle]").click()
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
cy.get(".spectrum-Modal").within(() => {
|
||||||
cy.get("input").eq(0).type(screenName).blur()
|
cy.get("input").first().type(screenName)
|
||||||
if (route) {
|
cy.get("input").eq(1).type(route)
|
||||||
cy.get("input").eq(1).type(route).blur()
|
cy.get(".spectrum-Button--cta").click()
|
||||||
}
|
|
||||||
cy.contains("Create Screen").click()
|
|
||||||
})
|
})
|
||||||
cy.get(".nav-items-container").within(() => {
|
cy.get(".nav-items-container").within(() => {
|
||||||
cy.contains(route).should("exist")
|
cy.contains(route).should("exist")
|
||||||
|
|
Loading…
Reference in New Issue