Skip to content

Commit dddfbed

Browse files
authored
chore: minor updates to form feedback components (bootstrap-vue#3881)
1 parent 6d382ed commit dddfbed

File tree

4 files changed

+4
-48
lines changed

4 files changed

+4
-48
lines changed

src/components/form/form-invalid-feedback.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const props = {
1919
default: false
2020
},
2121
state: {
22-
type: [Boolean, String],
22+
type: Boolean,
2323
default: null
2424
},
2525
ariaLive: {
@@ -38,7 +38,7 @@ export const BFormInvalidFeedback = /*#__PURE__*/ Vue.extend({
3838
functional: true,
3939
props,
4040
render(h, { props, data, children }) {
41-
const show = props.forceShow === true || props.state === false || props.state === 'invalid'
41+
const show = props.forceShow === true || props.state === false
4242
return h(
4343
props.tag,
4444
mergeData(data, {

src/components/form/form-invalid-feedback.spec.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ describe('form-invalid-feedback', () => {
7171
expect(feedback.classes()).toContain('d-block')
7272
})
7373

74-
it('should contain class d-block when state is "invalid"', async () => {
75-
const feedback = mount(BFormInvalidFeedback, {
76-
context: {
77-
props: {
78-
state: 'invalid'
79-
}
80-
}
81-
})
82-
expect(feedback.classes()).toContain('d-block')
83-
})
84-
8574
it('should not contain class d-block when state is true', async () => {
8675
const feedback = mount(BFormInvalidFeedback, {
8776
context: {
@@ -93,17 +82,6 @@ describe('form-invalid-feedback', () => {
9382
expect(feedback.classes()).not.toContain('d-block')
9483
})
9584

96-
it('should not contain class d-block when state is "valid"', async () => {
97-
const feedback = mount(BFormInvalidFeedback, {
98-
context: {
99-
props: {
100-
state: 'valid'
101-
}
102-
}
103-
})
104-
expect(feedback.classes()).not.toContain('d-block')
105-
})
106-
10785
it('should contain class d-block when force-show is true and state is true', async () => {
10886
const feedback = mount(BFormInvalidFeedback, {
10987
context: {

src/components/form/form-valid-feedback.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const props = {
1919
default: false
2020
},
2121
state: {
22-
type: [Boolean, String],
22+
type: Boolean,
2323
default: null
2424
},
2525
ariaLive: {
@@ -38,7 +38,7 @@ export const BFormValidFeedback = /*#__PURE__*/ Vue.extend({
3838
functional: true,
3939
props,
4040
render(h, { props, data, children }) {
41-
const show = props.forceShow === true || props.state === true || props.state === 'valid'
41+
const show = props.forceShow === true || props.state === true
4242
return h(
4343
props.tag,
4444
mergeData(data, {

src/components/form/form-valid-feedback.spec.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ describe('form-valid-feedback', () => {
7171
expect(feedback.classes()).toContain('d-block')
7272
})
7373

74-
it('should contain class d-block when state is "valid"', async () => {
75-
const feedback = mount(BFormValidFeedback, {
76-
context: {
77-
props: {
78-
state: 'valid'
79-
}
80-
}
81-
})
82-
expect(feedback.classes()).toContain('d-block')
83-
})
84-
8574
it('should not contain class d-block when state is false', async () => {
8675
const feedback = mount(BFormValidFeedback, {
8776
context: {
@@ -93,17 +82,6 @@ describe('form-valid-feedback', () => {
9382
expect(feedback.classes()).not.toContain('d-block')
9483
})
9584

96-
it('should not contain class d-block when state is "invalid"', async () => {
97-
const feedback = mount(BFormValidFeedback, {
98-
context: {
99-
props: {
100-
state: 'invalid'
101-
}
102-
}
103-
})
104-
expect(feedback.classes()).not.toContain('d-block')
105-
})
106-
10785
it('should contain class d-block when force-show is true and state is false', async () => {
10886
const feedback = mount(BFormValidFeedback, {
10987
context: {

0 commit comments

Comments
 (0)