Skip to content

Commit d858349

Browse files
Ensure no-default-alt-text tests against Screencast (#105)
1 parent 197bd53 commit d858349

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/rules/no-default-alt-text.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* * "Screen Shot 2020-10-20 at 2 52 27 PM"
44
* * "Screenshot 2020-10-20 at 2 52 27 PM"
55
* * "Clean Shot 2020-10-20 @45x"
6+
* * "Screencast from 23 02 2024 19 15 19]"
67
*/
78
const defaultScreenshotRegex =
8-
"(?:screen|clean) ?shot \\d{4}-\\d{2}-\\d{2}[^'\"\\]]*";
9+
"(?:screen|clean) ?(?:shot|cast) \\d{4}-\\d{2}-\\d{2}[^'\"\\]]*";
910

1011
const imageRegex = "image";
1112
const combinedRegex = `(${[defaultScreenshotRegex, imageRegex].join("|")})`;

test/no-default-alt-text.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe("GH001: No Default Alt Text", () => {
2626
test("markdown example", async () => {
2727
const strings = [
2828
"![Screen Shot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
29+
"![Screencast from 23 02 2024 19 15 19](https://user-images.githubusercontent.com/abcdef.png)",
2930
"![ScreenShot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
3031
"![Screen shot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
3132
"![Screenshot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
@@ -50,6 +51,7 @@ describe("GH001: No Default Alt Text", () => {
5051
test("HTML example", async () => {
5152
const strings = [
5253
'<img alt="Screen Shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',
54+
'<img alt=" Screencast from 23 02 2024 19 15 19" src="https://user-images.githubusercontent.com/abcdef.png">',
5355
'<img alt="ScreenShot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',
5456
'<img alt="Screen shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',
5557
'<img alt="Screenshot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',

0 commit comments

Comments
 (0)