Skip to content

Commit

Permalink
Added tests for internal vuetify classes that we rely on for styling (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
grolu authored Jan 23, 2025
1 parent 10a4d24 commit 9a9975c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions frontend/__tests__/components/Vuetify.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ describe('components', () => {

expect(wrapper.find('.v-main > div[class$=\'wrap\']').text()).toBe(text)
})

it('should apply theme classes to application', () => {
const wrapper = mountApplication()
expect(wrapper.classes()).toContain('v-theme--light')
})
})

describe('v-messages', () => {
Expand Down Expand Up @@ -104,4 +109,40 @@ describe('components', () => {
expect(wrapper.find(selector).text()).toBe(hint)
})
})

describe('v-breadcrumbs', () => {
it('should be able to find v-breadcrumbs-item v-breadcrumbs-item--disabled class', () => {
const Component = {
template: '<v-breadcrumbs><v-breadcrumbs-item disabled>test</v-breadcrumbs-item></v-breadcrumbs>',
}
const wrapper = mount(Component, {
global: {
plugins: [
createVuetifyPlugin(),
],
},
})
const breadcrumbsItem = wrapper.find('.v-breadcrumbs-item')
expect(breadcrumbsItem.exists()).toBe(true)
expect(breadcrumbsItem.classes()).toContain('v-breadcrumbs-item--disabled')
})
})

describe('v-btn', () => {
it('should be able to find v-btn icon class', () => {
const Component = {
template: '<v-btn icon="mdi-foo" />',
}
const wrapper = mount(Component, {
global: {
plugins: [
createVuetifyPlugin(),
],
},
})
const iconItem = wrapper.find('.v-icon')
expect(iconItem.exists()).toBe(true)
expect(iconItem.classes()).toContain('v-icon')
})
})
})

0 comments on commit 9a9975c

Please sign in to comment.