[Improvement] Mixins: treat empty string as true for boolean props (#468)

This commit is contained in:
Li Chuangbo
2017-12-22 17:08:50 +13:00
committed by neverland
parent b67c9956b2
commit 57abc04346
5 changed files with 23 additions and 1 deletions

View File

@@ -113,4 +113,16 @@ describe('Popup', () => {
}, 300);
}, 300);
});
it('treat empty string as true for boolean props', () => {
wrapper = mount(Popup, {
propsData: {
overlay: '',
lockOnScroll: '',
closeOnClickOverlay: ''
}
});
expect(wrapper.vm.lockOnScroll).to.be.true;
});
});