Skip to content

Commit 1ba3cec

Browse files
committed
test(vue): fixes assertions for forbidden cases
1 parent 42ee540 commit 1ba3cec

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/casl-vue/spec/can.spec.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('`Can` component', () => {
4444
</Can>
4545
`)
4646

47-
expect(wrapper.isEmpty()).to.be.true
47+
expect(wrapper.contains('h1')).to.be.false
4848
})
4949

5050
it('does not render children if `Ability` instance disallows to do an action', () => {
@@ -54,7 +54,7 @@ describe('`Can` component', () => {
5454
</Can>
5555
`)
5656

57-
expect(wrapper.isEmpty()).to.be.true
57+
expect(wrapper.contains('h1')).to.be.false
5858
})
5959

6060
describe('props validation', () => {
@@ -87,10 +87,9 @@ describe('`Can` component', () => {
8787
})
8888
})
8989

90-
function render(template, options) {
91-
return mount({ template: `<div>${template}</div>` }, {
92-
localVue: LocalVue,
93-
...options
90+
function render(template) {
91+
return mount({ template: `<div>${template.trim()}</div>` }, {
92+
localVue: LocalVue
9493
})
9594
}
9695
})

0 commit comments

Comments
 (0)