import { mount } from '@vue/test-utils' import { expect, describe, it } from 'vitest' import BackBtn from '../BackBtn.vue' import { VIcon, VBtn } from 'vuetify/components' describe('BackBtn', () => { it('render correctly', async () => { const wrapper = mount(BackBtn, { component: { VIcon, VBtn, }, }) expect(wrapper.exists()).toBe(true) }) it('hides back icon when hideBackIcon is true', () => { const wrapper = mount(BackBtn, { component: { VIcon, VBtn, }, props: { hideBackIcon: true }, }) expect(wrapper.find('VIcon').exists()).toBe(false) }) it('returns false when dark prop is not provided', () => { const wrapper = mount(BackBtn, { component: { VIcon, VBtn, }, }) expect(wrapper.vm.dark).toBe(false) }) it('returns true when dark prop is true', () => { const wrapper = mount(BackBtn, { component: { VIcon, VBtn, }, props: { dark: true }, }) expect(wrapper.vm.dark).toBe(true) }) it('returns false when dark prop is false', () => { const wrapper = mount(BackBtn, { component: { VIcon, VBtn, }, props: { dark: false }, }) expect(wrapper.vm.dark).toBe(false) }) // Le ring de focus est géré globalement (_btns.scss) : ces tests vérifient les // prérequis structurels de ce ring (jsdom ne calcule pas le style :focus-visible). describe('focus', () => { it('renders a native