-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from baiyaaaaa/test/component/layout
Test/component/layout
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { createVue } from '../util'; | ||
|
||
describe('Col', () => { | ||
it('create', () => { | ||
const vm = createVue({ | ||
template: ` | ||
<el-col :span="12"> | ||
</el-col> | ||
` | ||
}, true); | ||
let colElm = vm.$el; | ||
expect(colElm.classList.contains('el-col')).to.be.true; | ||
}); | ||
it('span', () => { | ||
const vm = createVue({ | ||
template: ` | ||
<el-col :span="12"> | ||
</el-col> | ||
` | ||
}, true); | ||
let colElm = vm.$el; | ||
expect(colElm.classList.contains('el-col-12')).to.be.true; | ||
}); | ||
it('pull', () => { | ||
const vm = createVue({ | ||
template: ` | ||
<el-col :span="12" :pull="3"> | ||
</el-col> | ||
` | ||
}, true); | ||
let colElm = vm.$el; | ||
expect(colElm.classList.contains('el-col-pull-3')).to.be.true; | ||
}); | ||
it('push', () => { | ||
const vm = createVue({ | ||
template: ` | ||
<el-col :span="12" :push="3"> | ||
</el-col> | ||
` | ||
}, true); | ||
let colElm = vm.$el; | ||
expect(colElm.classList.contains('el-col-push-3')).to.be.true; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}); | ||
}); |