Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoTod committed May 25, 2024
1 parent 5664930 commit 0f7627a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/cypress/integration/plugins/csp-compatibility.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,26 @@ test.csp('Can use components and basic expressions with CSP-compatible build',
get('span').should(haveText('baz'))
}
)

test.csp('Supports nested properties',
[html`
<div x-data="test">
<span x-text="foo.bar"></span>
<button @click="foo.change">Change Foo</button>
</div>
`,
`
Alpine.data('test', () => ({
foo: {
bar: 'baz',
change() { this.foo.bar = 'qux' },
}
}))
`],
({ get }) => {
get('span').should(haveText('baz'))
get('button').click()
get('span').should(haveText('qux'))
}
)

0 comments on commit 0f7627a

Please sign in to comment.