Skip to content

Commit

Permalink
feat(MdBadge): add prop validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuell1 committed Apr 10, 2018
1 parent e136096 commit a53aff6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 0 additions & 7 deletions src/components/MdBadge/MdBadge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@ test('should render the badge', async () => {
expect(wrapper.hasClass('md-badge')).toBe(true)
expect(wrapper.text()).toBe('Lorem ipsum')
})

test('should render the theme class', async () => {
const template = '<md-badge md-theme="alt">Lorem ipsum</md-badge>'
const wrapper = await mountTemplate(MdBadge, template)

expect(wrapper.hasClass('md-theme-alt')).toBe(true)
})
7 changes: 6 additions & 1 deletion src/components/MdBadge/MdBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<script>
import MdComponent from 'core/MdComponent'
import MdPropValidator from 'core/utils/MdPropValidator'
import MdBadgeStandalone from './MdBadgeStandalone'
Expand All @@ -26,7 +27,11 @@
mdContent: [String, Number],
mdPosition: {
type: String,
default: 'top'
default: 'top',
...MdPropValidator('md-position', [
'top',
'bottom'
])
},
mdDense: Boolean
},
Expand Down

0 comments on commit a53aff6

Please sign in to comment.