@@ -33,6 +33,8 @@ describe("GH001: No Default Alt Text", () => {
3333 "" ,
3434 "" ,
3535 "" ,
36+ "" ,
37+ "" ,
3638 ] ;
3739
3840 const results = await runTest ( strings , altTextRule ) ;
@@ -42,7 +44,7 @@ describe("GH001: No Default Alt Text", () => {
4244 . flat ( )
4345 . filter ( ( name ) => ! name . includes ( "GH" ) ) ;
4446
45- expect ( failedRules ) . toHaveLength ( 4 ) ;
47+ expect ( failedRules ) . toHaveLength ( 6 ) ;
4648 for ( const rule of failedRules ) {
4749 expect ( rule ) . toBe ( "no-default-alt-text" ) ;
4850 }
@@ -54,6 +56,8 @@ describe("GH001: No Default Alt Text", () => {
5456 '<img alt="ScreenShot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">' ,
5557 '<img alt="Screen shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">' ,
5658 '<img alt="Screenshot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">' ,
59+ '<img alt="Image" src="https://user-images.githubusercontent.com/abcdef.png">' ,
60+ '<img alt="image" src="https://user-images.githubusercontent.com/abcdef.png">' ,
5761 ] ;
5862
5963 const results = await runTest ( strings , altTextRule ) ;
@@ -63,7 +67,7 @@ describe("GH001: No Default Alt Text", () => {
6367 . flat ( )
6468 . filter ( ( name ) => ! name . includes ( "GH" ) ) ;
6569
66- expect ( failedRules ) . toHaveLength ( 4 ) ;
70+ expect ( failedRules ) . toHaveLength ( 6 ) ;
6771 for ( const rule of failedRules ) {
6872 expect ( rule ) . toBe ( "no-default-alt-text" ) ;
6973 }
@@ -78,13 +82,13 @@ describe("GH001: No Default Alt Text", () => {
7882 const results = await runTest ( strings , altTextRule ) ;
7983
8084 expect ( results [ 0 ] . ruleDescription ) . toMatch (
81- / I m a g e s s h o u l d n o t u s e t h e M a c O S d e f a u l t s c r e e n s h o t f i l e n a m e a s a l t e r n a t e t e x t /
85+ " Images should set meaningful alternative text (alt text), and not use the macOS default screenshot filename or `Image`."
8286 ) ;
8387 expect ( results [ 0 ] . errorDetail ) . toBe (
8488 "For image: Screen Shot 2022-06-26 at 7 41 30 PM"
8589 ) ;
8690 expect ( results [ 1 ] . ruleDescription ) . toMatch (
87- / I m a g e s s h o u l d n o t u s e t h e M a c O S d e f a u l t s c r e e n s h o t f i l e n a m e a s a l t e r n a t e t e x t /
91+ " Images should set meaningful alternative text (alt text), and not use the macOS default screenshot filename or `Image`."
8892 ) ;
8993 expect ( results [ 1 ] . errorDetail ) . toBe (
9094 'For image: <img alt="Screen Shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">'
0 commit comments