Skip to content

Commit

Permalink
add test support
Browse files Browse the repository at this point in the history
  • Loading branch information
khiga8 committed Oct 6, 2023
1 parent 0f707f9 commit 8cf33cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/no-default-alt-text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ describe("GH001: No Default Alt Text", () => {
}
});

test("flags multiple consecutive inline images", async () => {
const strings = ['<img alt="image"><img alt="Image">'];
const results = await runTest(strings, altTextRule);
expect(results).toHaveLength(2);

expect(results[0].errorRange).toEqual([11, 5]);
expect(results[0].errorDetail).toEqual("Flagged alt: image");
expect(results[1].errorRange).toEqual([28, 5]);
expect(results[1].errorDetail).toEqual("Flagged alt: Image");
});

test("error message", async () => {
const strings = [
"![Screen Shot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
Expand Down

0 comments on commit 8cf33cc

Please sign in to comment.