@gitlab/ui 99.1.0 → 101.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/components/base/badge/badge.js +88 -4
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -2
- package/dist/vendor/bootstrap-vue/src/index.js +0 -1
- package/package.json +2 -4
- package/src/components/base/badge/badge.md +5 -13
- package/src/components/base/badge/badge.scss +6 -1
- package/src/components/base/badge/badge.vue +86 -10
- package/src/scss/bootstrap.scss +33 -33
- package/src/scss/bootstrap_vue.scss +0 -4
- package/src/scss/storybook.scss +3 -3
- package/src/vendor/bootstrap-vue/package.json +0 -1
- package/src/vendor/bootstrap-vue/src/constants/components.js +0 -1
- package/src/vendor/bootstrap-vue/src/index.js +0 -3
- package/dist/vendor/bootstrap-vue/src/components/badge/badge.js +0 -53
- package/dist/vendor/bootstrap-vue/src/components/badge/index.js +0 -1
- package/src/vendor/bootstrap-vue/src/components/badge/README.md +0 -126
- package/src/vendor/bootstrap-vue/src/components/badge/badge.js +0 -55
- package/src/vendor/bootstrap-vue/src/components/badge/badge.spec.js +0 -141
- package/src/vendor/bootstrap-vue/src/components/badge/index.d.ts +0 -7
- package/src/vendor/bootstrap-vue/src/components/badge/index.js +0 -3
- package/src/vendor/bootstrap-vue/src/components/badge/package.json +0 -29
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
2
|
-
import { BBadge } from './badge'
|
|
3
|
-
|
|
4
|
-
describe('badge', () => {
|
|
5
|
-
it('should have base classes', async () => {
|
|
6
|
-
const wrapper = mount(BBadge)
|
|
7
|
-
|
|
8
|
-
expect(wrapper.element.tagName).toBe('SPAN')
|
|
9
|
-
expect(wrapper.classes()).toContain('badge')
|
|
10
|
-
expect(wrapper.classes()).toContain('badge-secondary')
|
|
11
|
-
expect(wrapper.classes()).not.toContain('badge-pill')
|
|
12
|
-
expect(wrapper.classes()).not.toContain('active')
|
|
13
|
-
expect(wrapper.classes()).not.toContain('disabled')
|
|
14
|
-
expect(wrapper.attributes('href')).toBeUndefined()
|
|
15
|
-
|
|
16
|
-
wrapper.destroy()
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('should have default slot content', async () => {
|
|
20
|
-
const wrapper = mount(BBadge, {
|
|
21
|
-
slots: {
|
|
22
|
-
default: 'foobar'
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
expect(wrapper.element.tagName).toBe('SPAN')
|
|
27
|
-
expect(wrapper.text()).toBe('foobar')
|
|
28
|
-
expect(wrapper.classes()).toContain('badge')
|
|
29
|
-
expect(wrapper.classes()).toContain('badge-secondary')
|
|
30
|
-
expect(wrapper.classes()).not.toContain('badge-pill')
|
|
31
|
-
expect(wrapper.classes()).not.toContain('active')
|
|
32
|
-
expect(wrapper.classes()).not.toContain('disabled')
|
|
33
|
-
expect(wrapper.attributes('href')).toBeUndefined()
|
|
34
|
-
|
|
35
|
-
wrapper.destroy()
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('should apply variant class', async () => {
|
|
39
|
-
const wrapper = mount(BBadge, {
|
|
40
|
-
propsData: {
|
|
41
|
-
variant: 'danger'
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
expect(wrapper.element.tagName).toBe('SPAN')
|
|
46
|
-
expect(wrapper.classes()).toContain('badge-danger')
|
|
47
|
-
expect(wrapper.classes()).toContain('badge')
|
|
48
|
-
expect(wrapper.classes()).not.toContain('badge-pill')
|
|
49
|
-
expect(wrapper.classes()).not.toContain('active')
|
|
50
|
-
expect(wrapper.classes()).not.toContain('disabled')
|
|
51
|
-
|
|
52
|
-
wrapper.destroy()
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
it('should apply pill class', async () => {
|
|
56
|
-
const wrapper = mount(BBadge, {
|
|
57
|
-
propsData: {
|
|
58
|
-
pill: true
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
expect(wrapper.element.tagName).toBe('SPAN')
|
|
63
|
-
expect(wrapper.classes()).toContain('badge-pill')
|
|
64
|
-
expect(wrapper.classes()).toContain('badge')
|
|
65
|
-
expect(wrapper.classes()).toContain('badge-secondary')
|
|
66
|
-
expect(wrapper.classes()).not.toContain('active')
|
|
67
|
-
expect(wrapper.classes()).not.toContain('disabled')
|
|
68
|
-
|
|
69
|
-
wrapper.destroy()
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('should have active class when prop active set', async () => {
|
|
73
|
-
const wrapper = mount(BBadge, {
|
|
74
|
-
propsData: {
|
|
75
|
-
active: true
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
expect(wrapper.element.tagName).toBe('SPAN')
|
|
80
|
-
expect(wrapper.classes()).toContain('active')
|
|
81
|
-
expect(wrapper.classes()).toContain('badge-secondary')
|
|
82
|
-
expect(wrapper.classes()).toContain('badge')
|
|
83
|
-
expect(wrapper.classes()).not.toContain('badge-pill')
|
|
84
|
-
expect(wrapper.classes()).not.toContain('disabled')
|
|
85
|
-
|
|
86
|
-
wrapper.destroy()
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
it('should have disabled class when prop disabled set', async () => {
|
|
90
|
-
const wrapper = mount(BBadge, {
|
|
91
|
-
propsData: {
|
|
92
|
-
disabled: true
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
expect(wrapper.element.tagName).toBe('SPAN')
|
|
97
|
-
expect(wrapper.classes()).toContain('disabled')
|
|
98
|
-
expect(wrapper.classes()).toContain('badge-secondary')
|
|
99
|
-
expect(wrapper.classes()).toContain('badge')
|
|
100
|
-
expect(wrapper.classes()).not.toContain('badge-pill')
|
|
101
|
-
expect(wrapper.classes()).not.toContain('active')
|
|
102
|
-
|
|
103
|
-
wrapper.destroy()
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
it('renders custom root element', async () => {
|
|
107
|
-
const wrapper = mount(BBadge, {
|
|
108
|
-
propsData: {
|
|
109
|
-
tag: 'small'
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
expect(wrapper.element.tagName).toBe('SMALL')
|
|
114
|
-
expect(wrapper.classes()).toContain('badge')
|
|
115
|
-
expect(wrapper.classes()).toContain('badge-secondary')
|
|
116
|
-
expect(wrapper.classes()).not.toContain('badge-pill')
|
|
117
|
-
expect(wrapper.classes()).not.toContain('active')
|
|
118
|
-
expect(wrapper.classes()).not.toContain('disabled')
|
|
119
|
-
|
|
120
|
-
wrapper.destroy()
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
it('renders link when href provided', async () => {
|
|
124
|
-
const wrapper = mount(BBadge, {
|
|
125
|
-
propsData: {
|
|
126
|
-
href: '/foo/bar'
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
expect(wrapper.element.tagName).toBe('A')
|
|
131
|
-
expect(wrapper.attributes('href')).toBeDefined()
|
|
132
|
-
expect(wrapper.attributes('href')).toBe('/foo/bar')
|
|
133
|
-
expect(wrapper.classes()).toContain('badge')
|
|
134
|
-
expect(wrapper.classes()).toContain('badge-secondary')
|
|
135
|
-
expect(wrapper.classes()).not.toContain('badge-pill')
|
|
136
|
-
expect(wrapper.classes()).not.toContain('active')
|
|
137
|
-
expect(wrapper.classes()).not.toContain('disabled')
|
|
138
|
-
|
|
139
|
-
wrapper.destroy()
|
|
140
|
-
})
|
|
141
|
-
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bootstrap-vue/badge",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"meta": {
|
|
5
|
-
"title": "Badge",
|
|
6
|
-
"description": "Small and adaptive tag for adding context to just about any content.",
|
|
7
|
-
"components": [
|
|
8
|
-
{
|
|
9
|
-
"component": "BBadge",
|
|
10
|
-
"props": [
|
|
11
|
-
{
|
|
12
|
-
"prop": "pill",
|
|
13
|
-
"description": "When set to 'true', renders the badge in pill style"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"prop": "variant",
|
|
17
|
-
"description": "Applies one of the Bootstrap theme color variants to the component"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
"slots": [
|
|
21
|
-
{
|
|
22
|
-
"name": "default",
|
|
23
|
-
"description": "Content to place in the badge"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|