1
0
Fork 0
mirror of synced 2024-06-18 18:35:37 +12:00

Updating binding tests.

This commit is contained in:
mike12345567 2021-05-25 16:52:35 +01:00
parent 923599df70
commit e2c9c06f98
2 changed files with 9 additions and 9 deletions

View file

@ -36,7 +36,9 @@ context("Create Bindings", () => {
it("should add a binding with a handlebars helper", () => {
cy.addComponent("Elements", "Paragraph").then(componentId => {
// 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")
})
})
@ -51,6 +53,6 @@ const addSettingBinding = (setting, bindingText, clickOption = true) => {
} else {
cy.get("textarea").type(bindingText)
}
cy.get("button").click()
cy.contains("Save").click()
})
}

View file

@ -150,17 +150,15 @@ Cypress.Commands.add("getComponent", componentId => {
})
Cypress.Commands.add("navigateToFrontend", () => {
cy.contains("design").click()
cy.contains("Design").click()
})
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("input").eq(0).type(screenName).blur()
if (route) {
cy.get("input").eq(1).type(route).blur()
}
cy.contains("Create Screen").click()
cy.get("input").first().type(screenName)
cy.get("input").eq(1).type(route)
cy.get(".spectrum-Button--cta").click()
})
cy.get(".nav-items-container").within(() => {
cy.contains(route).should("exist")