1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

wip: cypress tests

This commit is contained in:
kevmodrome 2020-09-03 09:45:58 +02:00
parent 40e6d51d24
commit 68dfb678e1
2 changed files with 4 additions and 8 deletions

View file

@ -2,9 +2,6 @@ context('Create a Binding', () => {
before(() => {
cy.visit('localhost:4001/_builder')
cy.createApp('Binding App', 'Binding App Description')
cy.createTable('dog')
cy.addColumn('dog', 'name', 'Plain Text')
cy.addRecord(["Rover"])
cy.navigateToFrontend()
})
@ -16,7 +13,6 @@ context('Create a Binding', () => {
cy.contains("Heading").click()
cy.get("[data-cy=text-binding-button]").click()
cy.get("[data-cy=binding-dropdown-modal]").contains('Input 1').click()
cy.contains('Home{{ Input 1 }}')
cy.get("[data-cy=binding-dropdown-modal] textarea").should('have.value', 'Home{{ Input 1 }}')
})
})

View file

@ -20,12 +20,12 @@
handleChange(key, temporaryBindableValue)
}
let bindableProperties
let bindableProperties = []
let anchor
let dropdown
async function getBindableProperties() {
function getBindableProperties() {
// Get all bindableProperties
bindableProperties = fetchBindableProperties({
componentInstanceId: $store.currentComponentInfo._id,
@ -36,7 +36,7 @@
}
const CAPTURE_VAR_INSIDE_MUSTACHE = /{{([^}]+)}}/g
async function replaceBindings(textWithBindings) {
function replaceBindings(textWithBindings) {
getBindableProperties()
// Find all instances of mustasche
const boundValues = textWithBindings.match(CAPTURE_VAR_INSIDE_MUSTACHE)