import { mount } from '@vue/test-utils' import { describe, expect, it } from 'vitest' import AlertBox from '../../components/AlertBox.vue' describe('AlertBox', () => { it('should render the action as a small secondary BaseButton when actionLabel is set (1h)', () => { const wrapper = mount(AlertBox, { props: { type: 'warning', actionLabel: 'Recalibrate' } }) expect(wrapper.get('.mint-alert__actions button').classes()).toEqual( expect.arrayContaining(['mint-button', 'mint-button--secondary', 'mint-button--sm']), ) }) it('should emit action when the action button is clicked', async () => { const wrapper = mount(AlertBox, { props: { actionLabel: 'Retry' } }) await wrapper.get('.mint-alert__actions button').trigger('click') expect(wrapper.emitted('action')).toHaveLength(1) }) })