Skip to content

Commit d59ba53

Browse files
authored
tests: complete layout tests (bootstrap-vue#1452)
1 parent 686de49 commit d59ba53

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

src/components/layout/col.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,9 @@ describe('col', async () => {
103103
const { $refs } = window.app
104104
expect($refs.tag).toBeElement('section')
105105
})
106+
107+
it("should apply '.align-self-*' class with 'align-self' prop", async () => {
108+
const { $refs } = window.app
109+
expect($refs.alignSelf).toHaveClass('align-self-center')
110+
})
106111
})

src/components/layout/container.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { loadFixture, testVM } from '../../../tests/utils'
22

3-
describe('form-row', async () => {
3+
describe('container', async () => {
44
beforeEach(loadFixture(__dirname, 'container'))
55
testVM()
66

src/components/layout/fixtures/col.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ <h1>Hello Vue!</h1>
3636
</div>
3737
<b-col tag="section"
3838
ref="tag"></b-col>
39+
<b-col align-self="center" ref="alignSelf"></b-col>
3940
</div>
4041
</div>
4142
</div>
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<div id="app">
22
<!-- default -->
33
<b-row ref="default">default</b-row>
4-
<br>
54
<!-- custom tag prop -->
65
<b-row tag="p" ref="custom">custom</b-row>
7-
<br>
86
<!-- no-gutters prop -->
97
<b-row no-gutters ref="noGutters">no gutters</b-row>
8+
<!-- align-v prop -->
9+
<b-row align-v="center" ref="alignV">align v</b-row>
10+
<!-- align-h prop -->
11+
<b-row align-h="center" ref="alignH">align h</b-row>
12+
<!-- align-h prop -->
13+
<b-row align-content="center" ref="alignContent">align content</b-row>
1014
</div>

src/components/layout/row.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ describe('form-row', async () => {
2020
expect($refs.noGutters).toHaveClass('no-gutters')
2121
})
2222

23+
it('alignV should contain classes', async () => {
24+
const { app: { $refs } } = window
25+
expect($refs.alignV).toHaveClass('row')
26+
expect($refs.alignV).toHaveClass('align-items-center')
27+
})
28+
29+
it('alignH should contain classes', async () => {
30+
const { app: { $refs } } = window
31+
expect($refs.alignH).toHaveClass('row')
32+
expect($refs.alignH).toHaveClass('justify-content-center')
33+
})
34+
35+
it('alignContent should contain classes', async () => {
36+
const { app: { $refs } } = window
37+
expect($refs.alignContent).toHaveClass('row')
38+
expect($refs.alignContent).toHaveClass('align-content-center')
39+
})
40+
2341
it('default should have content', async () => {
2442
const { app: { $refs } } = window
2543
expect($refs.default.textContent).toContain('default')

0 commit comments

Comments
 (0)