@@ -116,6 +116,7 @@ vi.mock('vue-data-ui/vue-ui-xy', () => {
116116// Import components from #components where possible
117117// For server/client variants, we need to import directly to test the specific variant
118118import {
119+ Alert ,
119120 AppFooter ,
120121 AppHeader ,
121122 AppLogo ,
@@ -3547,6 +3548,35 @@ describe('component accessibility audits', () => {
35473548 expect ( results . violations ) . toEqual ( [ ] )
35483549 } )
35493550 } )
3551+
3552+ describe ( 'Alert' , ( ) => {
3553+ it ( 'should have no accessibility violations for warning variant' , async ( ) => {
3554+ const component = await mountSuspended ( Alert , {
3555+ props : { variant : 'warning' , title : 'Warning title' } ,
3556+ slots : { default : 'This is a warning message.' } ,
3557+ } )
3558+ const results = await runAxe ( component )
3559+ expect ( results . violations ) . toEqual ( [ ] )
3560+ } )
3561+
3562+ it ( 'should have no accessibility violations for error variant' , async ( ) => {
3563+ const component = await mountSuspended ( Alert , {
3564+ props : { variant : 'error' , title : 'Error title' } ,
3565+ slots : { default : 'This is an error message.' } ,
3566+ } )
3567+ const results = await runAxe ( component )
3568+ expect ( results . violations ) . toEqual ( [ ] )
3569+ } )
3570+
3571+ it ( 'should have no accessibility violations without title' , async ( ) => {
3572+ const component = await mountSuspended ( Alert , {
3573+ props : { variant : 'warning' } ,
3574+ slots : { default : 'This is a warning message.' } ,
3575+ } )
3576+ const results = await runAxe ( component )
3577+ expect ( results . violations ) . toEqual ( [ ] )
3578+ } )
3579+ } )
35503580} )
35513581
35523582function applyTheme ( colorMode : string , bgTheme : string | null ) {
@@ -3593,6 +3623,22 @@ describe('background theme accessibility', () => {
35933623 }
35943624
35953625 const components = [
3626+ {
3627+ name : 'AlertWarning' ,
3628+ mount : ( ) =>
3629+ mountSuspended ( Alert , {
3630+ props : { variant : 'warning' , title : 'Warning title' } ,
3631+ slots : { default : '<p>Warning body</p>' } ,
3632+ } ) ,
3633+ } ,
3634+ {
3635+ name : 'AlertError' ,
3636+ mount : ( ) =>
3637+ mountSuspended ( Alert , {
3638+ props : { variant : 'error' , title : 'Error title' } ,
3639+ slots : { default : '<p>Error body</p>' } ,
3640+ } ) ,
3641+ } ,
35963642 { name : 'AppHeader' , mount : ( ) => mountSuspended ( AppHeader ) } ,
35973643 { name : 'AppFooter' , mount : ( ) => mountSuspended ( AppFooter ) } ,
35983644 { name : 'HeaderSearchBox' , mount : ( ) => mountSuspended ( HeaderSearchBox ) } ,
0 commit comments