From da8099ecf6b67c97ea6b56308bfbcbb146768172 Mon Sep 17 00:00:00 2001 From: baiyaaaaa Date: Thu, 20 Oct 2016 01:02:07 +0800 Subject: [PATCH 1/2] row test --- test/unit/specs/row.spec.js | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/unit/specs/row.spec.js diff --git a/test/unit/specs/row.spec.js b/test/unit/specs/row.spec.js new file mode 100644 index 00000000000..f97774cb057 --- /dev/null +++ b/test/unit/specs/row.spec.js @@ -0,0 +1,39 @@ +import { createTest } from '../util'; +import Row from 'packages/row'; + +describe('Row', () => { + it('create', () => { + const vm = createTest(Row, true); + let rowElm = vm.$el; + expect(rowElm.classList.contains('el-row')).to.be.true; + }); + it('gutter', () => { + const vm = createTest(Row, { + gutter: 20 + }, true); + let rowElm = vm.$el; + expect(rowElm.style.marginLeft).to.be.equal('-10px'); + expect(rowElm.style.marginRight).to.be.equal('-10px'); + }); + it('type', () => { + const vm = createTest(Row, { + type: 'flex' + }, true); + let rowElm = vm.$el; + expect(rowElm.classList.contains('el-row--flex')).to.be.true; + }); + it('justify', () => { + const vm = createTest(Row, { + justify: 'end' + }, true); + let rowElm = vm.$el; + expect(rowElm.classList.contains('is-justify-end')).to.be.true; + }); + it('align', () => { + const vm = createTest(Row, { + align: 'bottom' + }, true); + let rowElm = vm.$el; + expect(rowElm.classList.contains('is-align-bottom')).to.be.true; + }); +}); From c3f14b02b165101bb53a817bbf83f6dce048751c Mon Sep 17 00:00:00 2001 From: baiyaaaaa Date: Thu, 20 Oct 2016 01:33:18 +0800 Subject: [PATCH 2/2] col test --- test/unit/specs/col.spec.js | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/unit/specs/col.spec.js diff --git a/test/unit/specs/col.spec.js b/test/unit/specs/col.spec.js new file mode 100644 index 00000000000..4bca7142bd1 --- /dev/null +++ b/test/unit/specs/col.spec.js @@ -0,0 +1,44 @@ +import { createVue } from '../util'; + +describe('Col', () => { + it('create', () => { + const vm = createVue({ + template: ` + + + ` + }, true); + let colElm = vm.$el; + expect(colElm.classList.contains('el-col')).to.be.true; + }); + it('span', () => { + const vm = createVue({ + template: ` + + + ` + }, true); + let colElm = vm.$el; + expect(colElm.classList.contains('el-col-12')).to.be.true; + }); + it('pull', () => { + const vm = createVue({ + template: ` + + + ` + }, true); + let colElm = vm.$el; + expect(colElm.classList.contains('el-col-pull-3')).to.be.true; + }); + it('push', () => { + const vm = createVue({ + template: ` + + + ` + }, true); + let colElm = vm.$el; + expect(colElm.classList.contains('el-col-push-3')).to.be.true; + }); +});