File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ module.exports = {
13
13
rules : {
14
14
"import/no-commonjs" : "off" ,
15
15
"filenames/match-regex" : "off" ,
16
+ "i18n-text/no-en" : "off" ,
16
17
} ,
17
18
} ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ module.exports = {
23
23
if ( image . content . match ( altTextRegex ) ) {
24
24
onError ( {
25
25
lineNumber : image . lineNumber ,
26
- details : `For image: ${ image . content } ` ,
26
+ detail : `For image: ${ image . content } ` ,
27
27
} ) ;
28
28
}
29
29
}
@@ -35,7 +35,7 @@ module.exports = {
35
35
if ( line . match ( altTextTagRegex ) ) {
36
36
onError ( {
37
37
lineNumber,
38
- details : `For image: ${ line } ` ,
38
+ detail : `For image: ${ line } ` ,
39
39
} ) ;
40
40
}
41
41
lineNumber ++ ;
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ describe("GH001: No Default Alt Text", () => {
75
75
expect ( rule ) . toBe ( thisRuleName ) ;
76
76
}
77
77
} ) ;
78
+
78
79
test ( "HTML example" , async ( ) => {
79
80
const strings = [
80
81
'<img alt="Screen Shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">' ,
@@ -95,5 +96,27 @@ describe("GH001: No Default Alt Text", () => {
95
96
expect ( rule ) . toBe ( thisRuleName ) ;
96
97
}
97
98
} ) ;
99
+
100
+ test ( "error message" , async ( ) => {
101
+ const strings = [
102
+ "" ,
103
+ '<img alt="Screen Shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">' ,
104
+ ] ;
105
+
106
+ const results = await runTest ( strings ) ;
107
+
108
+ expect ( results [ 0 ] . ruleDescription ) . toMatch (
109
+ / 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 /
110
+ ) ;
111
+ expect ( results [ 0 ] . errorDetail ) . toBe (
112
+ "For image: Screen Shot 2022-06-26 at 7 41 30 PM"
113
+ ) ;
114
+ expect ( results [ 1 ] . ruleDescription ) . toMatch (
115
+ / 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 /
116
+ ) ;
117
+ expect ( results [ 1 ] . errorDetail ) . toBe (
118
+ 'For image: <img alt="Screen Shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">'
119
+ ) ;
120
+ } ) ;
98
121
} ) ;
99
122
} ) ;
You can’t perform that action at this time.
0 commit comments