You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by da...@apache.org on 2017/07/24 12:36:57 UTC
[05/50] incubator-weex git commit: * [html5] update to eslint formate
@notdanger
* [html5] update to eslint formate @notdanger
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b8606a40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b8606a40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b8606a40
Branch: refs/heads/0.16-dev
Commit: b8606a405794a486a9bc21b65dd124d5c3e77e1a
Parents: d2315fb
Author: erha19 <fa...@gmail.com>
Authored: Tue Jul 18 14:35:04 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Tue Jul 18 14:35:04 2017 +0800
----------------------------------------------------------------------
html5/test/render/vue/utils/style.js | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b8606a40/html5/test/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/utils/style.js b/html5/test/render/vue/utils/style.js
index 31b672c..1f1e78f 100644
--- a/html5/test/render/vue/utils/style.js
+++ b/html5/test/render/vue/utils/style.js
@@ -18,8 +18,9 @@
*/
import {
supportHairlines,
+ supportSticky,
autoPrefix,
- // normalizeStyle,
+ normalizeStyle,
normalizeString,
normalizeNumber,
normalizeUnitsNum,
@@ -34,9 +35,14 @@ describe('style', function () {
it('should support using 0.5px to paint 1px width border', () => {
expect(supportHairlines()).to.be.false
window.devicePixelRatio = 2
- //phantomjs didn't support using 0.5px to paint 1px width border
+ // phantomjs didn't support using 0.5px to paint 1px width border
expect(supportHairlines()).to.be.false
})
+ it('should support stick style', () => {
+ // phantomjs support stick true
+ expect(supportSticky()).to.be.true
+ })
+
it('should normalize units numbers', () => {
expect(normalizeUnitsNum('100px')).to.equal(100 * scale + 'px')
expect(normalizeUnitsNum('100')).to.equal(100 * scale + 'px')
@@ -69,7 +75,21 @@ describe('style', function () {
expect(trimComment(cssText)).to.equal(trimmed)
})
})
-
+describe('normalizeStyle', () => {
+ const style = {
+ width: '200px',
+ flexDirection: 'row',
+ flex: 1,
+ transform: 'translate3d(100px, 100px, 0)'
+ }
+ it('should switch to suitble case', () => {
+ const res = normalizeStyle(style)
+ expect(normalizeString('transform', style.transform)).to.equal(res.transform)
+ expect(normalizeString('width', style.width)).to.equal(res.width)
+ expect(normalizeString('flexDirection', style.flexDirection)).to.equal(res.flexDirection)
+ expect(normalizeNumber('flex', style.flex)).to.equal(res.flex)
+ })
+})
describe('autoPrefix', () => {
const style = {
width: '200px',