From 1ba3cecf6a57d1c85d9089d44213ba5412f77306 Mon Sep 17 00:00:00 2001 From: Sergii Date: Wed, 30 May 2018 15:54:37 +0300 Subject: [PATCH] test(vue): fixes assertions for forbidden cases --- packages/casl-vue/spec/can.spec.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/casl-vue/spec/can.spec.js b/packages/casl-vue/spec/can.spec.js index ca4819616..a9bc85a21 100644 --- a/packages/casl-vue/spec/can.spec.js +++ b/packages/casl-vue/spec/can.spec.js @@ -44,7 +44,7 @@ describe('`Can` component', () => { `) - expect(wrapper.isEmpty()).to.be.true + expect(wrapper.contains('h1')).to.be.false }) it('does not render children if `Ability` instance disallows to do an action', () => { @@ -54,7 +54,7 @@ describe('`Can` component', () => { `) - expect(wrapper.isEmpty()).to.be.true + expect(wrapper.contains('h1')).to.be.false }) describe('props validation', () => { @@ -87,10 +87,9 @@ describe('`Can` component', () => { }) }) - function render(template, options) { - return mount({ template: `
${template}
` }, { - localVue: LocalVue, - ...options + function render(template) { + return mount({ template: `
${template.trim()}
` }, { + localVue: LocalVue }) } })