mirror of
https://github.com/baserow/baserow.git
synced 2026-12-05 00:38:35 +00:00
36 lines
750 B
JavaScript
36 lines
750 B
JavaScript
import { mount } from '@vue/test-utils'
|
|
import BadgeCounter from '@baserow/modules/core/components/BadgeCounter'
|
|
|
|
describe('BadgeCounter.vue', () => {
|
|
it('renders count correctly', () => {
|
|
const wrapper = mount(BadgeCounter, {
|
|
propsData: {
|
|
count: 5,
|
|
},
|
|
})
|
|
|
|
expect(wrapper.text()).toBe('5')
|
|
})
|
|
|
|
it('renders limit correctly', () => {
|
|
const wrapper = mount(BadgeCounter, {
|
|
propsData: {
|
|
count: 15,
|
|
limit: 10,
|
|
},
|
|
})
|
|
|
|
expect(wrapper.text()).toBe('9+')
|
|
})
|
|
|
|
it('hasOneDigitOnly computed property works correctly', () => {
|
|
const wrapper = mount(BadgeCounter, {
|
|
propsData: {
|
|
count: 5,
|
|
},
|
|
})
|
|
|
|
expect(wrapper.vm.hasOneDigitOnly).toBe(true)
|
|
})
|
|
})
|