Skip to content

Commit b23e473

Browse files
committed
wip
1 parent 1c4c22c commit b23e473

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/cypress/integration/plugins/csp-compatibility.spec.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test.csp('throws when parsing a property assignment',
6464
<button x-data x-on:click="$el.innerHTML = 'evil'"></button>
6565
`],
6666
(cy) => {
67-
cy.on('uncaught:exception', ({message}) => message.includes('Object assignments are prohibited') ? false : true)
67+
cy.on('uncaught:exception', ({message}) => message.includes('Property assignments are prohibited') ? false : true)
6868
cy.get('button').click()
6969
cy.get('button').should(notContain('evil'))
7070
},
@@ -216,15 +216,20 @@ test.csp('throws when using x-html directive',
216216
test.csp('throws when non-enumerable global is accessed',
217217
[html`
218218
<div x-data="app">
219-
<span x-text="obj() ? 'evil' : ''"></span>
219+
<button x-on:click="show = true"></button>
220+
<template x-if="show">
221+
<span x-text="obj() ? 'evil' : ''"></span>
222+
</template>
220223
</div>
221224
`,`
222225
Alpine.data('app', () => ({
226+
show: true,
223227
obj() { return Object },
224228
}))
225229
`],
226230
(cy) => {
227231
cy.on('uncaught:exception', ({message}) => message.includes('Accessing global variables is prohibited') ? false : true)
232+
cy.get('button').click()
228233
cy.get('span').should(notContain('evil'))
229234
},
230235
)

0 commit comments

Comments
 (0)