* [html5] improve validater/index.js unit test case
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5507e9f2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5507e9f2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5507e9f2 Branch: refs/heads/0.15-dev Commit: 5507e9f2e15082af28ade7ca846372beebeda8db Parents: 3103148 Author: erha19 <faterr...@gmail.com> Authored: Wed Jul 19 11:52:07 2017 +0800 Committer: erha19 <faterr...@gmail.com> Committed: Wed Jul 19 11:52:07 2017 +0800 ---------------------------------------------------------------------- html5/test/render/vue/validator/index.js | 28 ++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5507e9f2/html5/test/render/vue/validator/index.js ---------------------------------------------------------------------- diff --git a/html5/test/render/vue/validator/index.js b/html5/test/render/vue/validator/index.js index e525cf7..c5c657a 100644 --- a/html5/test/render/vue/validator/index.js +++ b/html5/test/render/vue/validator/index.js @@ -27,14 +27,32 @@ describe('validator', function () { }) it('validateStyles', () => { - const styles = { + const textStyles = { position: 'absolute', - color: '#dddddd' + opacity: 1, + 'font-style': 'normal', + 'font-weight': 'bold', + 'text-decoration': 'none', + 'text-align': 'center', + 'text-overflow': 'clip', + color: '#dddddd', + 'font-size': '12px' + } + const divStyles = { + position: 'absolute', + 'flex-direction': 'row', + 'justify-content': 'center', + 'align-items': 'center', + flex: 3, + width: '100px', + top: 0, + 'border-top-width': '1px', + 'border-top-style': 'solid', + 'margin-left': '10px' } - expect(validateStyles).to.be.a('function') - expect(validateStyles('text', styles)).to.be.true - expect(validateStyles('text', { opacity: 0.2 })).to.be.true + expect(validateStyles('text', textStyles)).to.be.true + expect(validateStyles('div', divStyles)).to.be.true }) it('validateStyles (invalid)', () => {