@@ -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 ,
@@ -3529,6 +3530,35 @@ describe('component accessibility audits', () => {
35293530 expect ( results . violations ) . toEqual ( [ ] )
35303531 } )
35313532 } )
3533+
3534+ describe ( 'Alert' , ( ) => {
3535+ it ( 'should have no accessibility violations for warning variant' , async ( ) => {
3536+ const component = await mountSuspended ( Alert , {
3537+ props : { variant : 'warning' , title : 'Warning title' } ,
3538+ slots : { default : 'This is a warning message.' } ,
3539+ } )
3540+ const results = await runAxe ( component )
3541+ expect ( results . violations ) . toEqual ( [ ] )
3542+ } )
3543+
3544+ it ( 'should have no accessibility violations for error variant' , async ( ) => {
3545+ const component = await mountSuspended ( Alert , {
3546+ props : { variant : 'error' , title : 'Error title' } ,
3547+ slots : { default : 'This is an error message.' } ,
3548+ } )
3549+ const results = await runAxe ( component )
3550+ expect ( results . violations ) . toEqual ( [ ] )
3551+ } )
3552+
3553+ it ( 'should have no accessibility violations without title' , async ( ) => {
3554+ const component = await mountSuspended ( Alert , {
3555+ props : { variant : 'warning' } ,
3556+ slots : { default : 'This is a warning message.' } ,
3557+ } )
3558+ const results = await runAxe ( component )
3559+ expect ( results . violations ) . toEqual ( [ ] )
3560+ } )
3561+ } )
35323562} )
35333563
35343564function applyTheme ( colorMode : string , bgTheme : string | null ) {
@@ -3575,6 +3605,22 @@ describe('background theme accessibility', () => {
35753605 }
35763606
35773607 const components = [
3608+ {
3609+ name : 'AlertWarning' ,
3610+ mount : ( ) =>
3611+ mountSuspended ( Alert , {
3612+ props : { variant : 'warning' , title : 'Warning title' } ,
3613+ slots : { default : '<p>Warning body</p>' } ,
3614+ } ) ,
3615+ } ,
3616+ {
3617+ name : 'AlertError' ,
3618+ mount : ( ) =>
3619+ mountSuspended ( Alert , {
3620+ props : { variant : 'error' , title : 'Error title' } ,
3621+ slots : { default : '<p>Error body</p>' } ,
3622+ } ) ,
3623+ } ,
35783624 { name : 'AppHeader' , mount : ( ) => mountSuspended ( AppHeader ) } ,
35793625 { name : 'AppFooter' , mount : ( ) => mountSuspended ( AppFooter ) } ,
35803626 { name : 'HeaderSearchBox' , mount : ( ) => mountSuspended ( HeaderSearchBox ) } ,
0 commit comments