Skip to content

chore: minor updates to form feedback components #3881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/form/form-invalid-feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const props = {
default: false
},
state: {
type: [Boolean, String],
type: Boolean,
default: null
},
ariaLive: {
Expand All @@ -38,7 +38,7 @@ export const BFormInvalidFeedback = /*#__PURE__*/ Vue.extend({
functional: true,
props,
render(h, { props, data, children }) {
const show = props.forceShow === true || props.state === false || props.state === 'invalid'
const show = props.forceShow === true || props.state === false
return h(
props.tag,
mergeData(data, {
Expand Down
22 changes: 0 additions & 22 deletions src/components/form/form-invalid-feedback.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ describe('form-invalid-feedback', () => {
expect(feedback.classes()).toContain('d-block')
})

it('should contain class d-block when state is "invalid"', async () => {
const feedback = mount(BFormInvalidFeedback, {
context: {
props: {
state: 'invalid'
}
}
})
expect(feedback.classes()).toContain('d-block')
})

it('should not contain class d-block when state is true', async () => {
const feedback = mount(BFormInvalidFeedback, {
context: {
Expand All @@ -93,17 +82,6 @@ describe('form-invalid-feedback', () => {
expect(feedback.classes()).not.toContain('d-block')
})

it('should not contain class d-block when state is "valid"', async () => {
const feedback = mount(BFormInvalidFeedback, {
context: {
props: {
state: 'valid'
}
}
})
expect(feedback.classes()).not.toContain('d-block')
})

it('should contain class d-block when force-show is true and state is true', async () => {
const feedback = mount(BFormInvalidFeedback, {
context: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/form-valid-feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const props = {
default: false
},
state: {
type: [Boolean, String],
type: Boolean,
default: null
},
ariaLive: {
Expand All @@ -38,7 +38,7 @@ export const BFormValidFeedback = /*#__PURE__*/ Vue.extend({
functional: true,
props,
render(h, { props, data, children }) {
const show = props.forceShow === true || props.state === true || props.state === 'valid'
const show = props.forceShow === true || props.state === true
return h(
props.tag,
mergeData(data, {
Expand Down
22 changes: 0 additions & 22 deletions src/components/form/form-valid-feedback.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ describe('form-valid-feedback', () => {
expect(feedback.classes()).toContain('d-block')
})

it('should contain class d-block when state is "valid"', async () => {
const feedback = mount(BFormValidFeedback, {
context: {
props: {
state: 'valid'
}
}
})
expect(feedback.classes()).toContain('d-block')
})

it('should not contain class d-block when state is false', async () => {
const feedback = mount(BFormValidFeedback, {
context: {
Expand All @@ -93,17 +82,6 @@ describe('form-valid-feedback', () => {
expect(feedback.classes()).not.toContain('d-block')
})

it('should not contain class d-block when state is "invalid"', async () => {
const feedback = mount(BFormValidFeedback, {
context: {
props: {
state: 'invalid'
}
}
})
expect(feedback.classes()).not.toContain('d-block')
})

it('should contain class d-block when force-show is true and state is false', async () => {
const feedback = mount(BFormValidFeedback, {
context: {
Expand Down