forked from ElemeFE/element
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrow.spec.js
44 lines (42 loc) · 1.06 KB
/
row.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { createTest, destroyVM } from '../util';
import Row from 'packages/row';
describe('Row', () => {
let vm;
afterEach(() => {
destroyVM(vm);
});
it('create', () => {
vm = createTest(Row, true);
let rowElm = vm.$el;
expect(rowElm.classList.contains('el-row')).to.be.true;
});
it('gutter', () => {
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', () => {
vm = createTest(Row, {
type: 'flex'
}, true);
let rowElm = vm.$el;
expect(rowElm.classList.contains('el-row--flex')).to.be.true;
});
it('justify', () => {
vm = createTest(Row, {
justify: 'end'
}, true);
let rowElm = vm.$el;
expect(rowElm.classList.contains('is-justify-end')).to.be.true;
});
it('align', () => {
vm = createTest(Row, {
align: 'bottom'
}, true);
let rowElm = vm.$el;
expect(rowElm.classList.contains('is-align-bottom')).to.be.true;
});
});