Commit 1d5aa3c8 authored by David Sveningsson's avatar David Sveningsson

fix(rules): use original wcag rule names

parent ac094744
Pipeline #125879946 passed with stages
in 10 minutes and 50 seconds
......@@ -12,7 +12,7 @@ Array [
"line": 1,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 1,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img",
"severity": 2,
"size": 3,
......
......@@ -14,7 +14,7 @@ Array [
"line": 1,
"message": "Anchor link must have a text describing its purpose",
"offset": 1,
"ruleId": "WCAG/H30",
"ruleId": "wcag/h30",
"selector": "a",
"severity": 2,
"size": 1,
......
......@@ -14,7 +14,7 @@ Array [
"line": 1,
"message": "<form> element must have a submit button",
"offset": 1,
"ruleId": "WCAG/H32",
"ruleId": "wcag/h32",
"selector": "form",
"severity": 2,
"size": 4,
......
......@@ -18,7 +18,7 @@ Array [
"line": 1,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 1,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img",
"severity": 2,
"size": 3,
......
......@@ -14,7 +14,7 @@ Array [
"line": 1,
"message": "<img> with empty alt text cannot have title attribute",
"offset": 5,
"ruleId": "WCAG/H67",
"ruleId": "wcag/h67",
"selector": "img",
"severity": 2,
"size": 5,
......
......@@ -14,7 +14,7 @@ Array [
"line": 1,
"message": "<fieldset> must have a <legend> as the first child",
"offset": 1,
"ruleId": "WCAG/H71",
"ruleId": "wcag/h71",
"selector": "fieldset",
"severity": 2,
"size": 8,
......
......@@ -1774,7 +1774,7 @@ Array [
"line": 2,
"message": "<fieldset> must have a <legend> as the first child",
"offset": 29,
"ruleId": "WCAG/H71",
"ruleId": "wcag/h71",
"selector": "fieldset:nth-child(1)",
"severity": 2,
"size": 8,
......@@ -3228,7 +3228,7 @@ Array [
"line": 25,
"message": "image used as submit button must have alt text",
"offset": 683,
"ruleId": "WCAG/H36",
"ruleId": "wcag/h36",
"selector": "input:nth-child(14)",
"severity": 2,
"size": 1,
......
......@@ -216,7 +216,7 @@ describe("toHTMLValidate()", () => {
expect(stripAnsi(error.message)).toMatchInlineSnapshot(`
"Expected HTML to be valid but had the following errors:
Anchor link must have a text describing its purpose [WCAG/H30]
Anchor link must have a text describing its purpose [wcag/h30]
<button> is missing required \\"type\\" attribute [element-required-attributes]
Element <button> is not permitted as descendant of <a> [element-permitted-content]
Mismatched close-tag, expected '</button>' but found '</i>'. [close-order]
......
......@@ -19,7 +19,7 @@ Array [
"line": 7,
"message": "Anchor link must have a text describing its purpose",
"offset": 128,
"ruleId": "WCAG/H30",
"ruleId": "wcag/h30",
"selector": "a:nth-child(4)",
"severity": 2,
"size": 1,
......@@ -30,7 +30,7 @@ Array [
"line": 8,
"message": "Anchor link must have a text describing its purpose",
"offset": 136,
"ruleId": "WCAG/H30",
"ruleId": "wcag/h30",
"selector": "a:nth-child(5)",
"severity": 2,
"size": 1,
......@@ -41,7 +41,7 @@ Array [
"line": 9,
"message": "Anchor link must have a text describing its purpose",
"offset": 149,
"ruleId": "WCAG/H30",
"ruleId": "wcag/h30",
"selector": "a:nth-child(6)",
"severity": 2,
"size": 1,
......@@ -52,7 +52,7 @@ Array [
"line": 10,
"message": "Anchor link must have a text describing its purpose",
"offset": 166,
"ruleId": "WCAG/H30",
"ruleId": "wcag/h30",
"selector": "a:nth-child(7)",
"severity": 2,
"size": 1,
......
......@@ -19,7 +19,7 @@ Array [
"line": 9,
"message": "<form> element must have a submit button",
"offset": 110,
"ruleId": "WCAG/H32",
"ruleId": "wcag/h32",
"selector": "form:nth-child(3)",
"severity": 2,
"size": 4,
......
......@@ -19,7 +19,7 @@ Array [
"line": 4,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 55,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img:nth-child(4)",
"severity": 2,
"size": 3,
......@@ -52,7 +52,7 @@ Array [
"line": 4,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 55,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img:nth-child(4)",
"severity": 2,
"size": 3,
......@@ -85,7 +85,7 @@ Array [
"line": 2,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 16,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img:nth-child(2)",
"severity": 2,
"size": 3,
......@@ -96,7 +96,7 @@ Array [
"line": 3,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 29,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img:nth-child(3)",
"severity": 2,
"size": 3,
......@@ -107,7 +107,7 @@ Array [
"line": 4,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 55,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img:nth-child(4)",
"severity": 2,
"size": 3,
......@@ -140,7 +140,7 @@ Array [
"line": 3,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 29,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img:nth-child(3)",
"severity": 2,
"size": 3,
......@@ -151,7 +151,7 @@ Array [
"line": 4,
"message": "<img> is missing required \\"alt\\" attribute",
"offset": 55,
"ruleId": "WCAG/H37",
"ruleId": "wcag/h37",
"selector": "img:nth-child(4)",
"severity": 2,
"size": 3,
......
......@@ -19,7 +19,7 @@ Array [
"line": 5,
"message": "<img> with empty alt text cannot have title attribute",
"offset": 70,
"ruleId": "WCAG/H67",
"ruleId": "wcag/h67",
"selector": "img:nth-child(5)",
"severity": 2,
"size": 5,
......@@ -30,7 +30,7 @@ Array [
"line": 6,
"message": "<img> with empty alt text cannot have title attribute",
"offset": 95,
"ruleId": "WCAG/H67",
"ruleId": "wcag/h67",
"selector": "img:nth-child(6)",
"severity": 2,
"size": 5,
......
......@@ -45,7 +45,7 @@ describe("wcag/h30", () => {
const report = htmlvalidate.validateString("<a></a>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H30",
"wcag/h30",
"Anchor link must have a text describing its purpose"
);
});
......@@ -55,7 +55,7 @@ describe("wcag/h30", () => {
const report = htmlvalidate.validateString("<a><img></a>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H30",
"wcag/h30",
"Anchor link must have a text describing its purpose"
);
});
......@@ -65,7 +65,7 @@ describe("wcag/h30", () => {
const report = htmlvalidate.validateString('<a><img alt=""></a>');
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H30",
"wcag/h30",
"Anchor link must have a text describing its purpose"
);
});
......
......@@ -12,11 +12,6 @@ class H30 extends Rule {
};
}
public constructor(options: void) {
super(options);
this.name = "WCAG/H30";
}
public setup(): void {
this.on("dom:ready", (event: DOMReadyEvent) => {
const links = event.document.getElementsByTagName("a");
......
......@@ -39,7 +39,7 @@ describe("wcag/h32", () => {
const report = htmlvalidate.validateString("<form></form>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H32",
"wcag/h32",
"<form> element must have a submit button"
);
});
......@@ -51,7 +51,7 @@ describe("wcag/h32", () => {
);
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H32",
"wcag/h32",
"<form> element must have a submit button"
);
});
......@@ -61,7 +61,7 @@ describe("wcag/h32", () => {
const report = htmlvalidate.validateString("<my-form></my-form>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H32",
"wcag/h32",
"<my-form> element must have a submit button"
);
});
......
......@@ -11,11 +11,6 @@ class H32 extends Rule {
};
}
public constructor(options: void) {
super(options);
this.name = "WCAG/H32";
}
public setup(): void {
/* query all tags with form property, normally this is only the <form> tag
* but with custom element metadata other tags might be considered form
......
......@@ -35,7 +35,7 @@ describe("wcag/h36", () => {
const report = htmlvalidate.validateString('<input type="image">');
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H36",
"wcag/h36",
"image used as submit button must have alt text"
);
});
......@@ -45,7 +45,7 @@ describe("wcag/h36", () => {
const report = htmlvalidate.validateString('<input type="image" alt="">');
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H36",
"wcag/h36",
"image used as submit button must have alt text"
);
});
......
......@@ -10,11 +10,6 @@ class H36 extends Rule {
};
}
public constructor(options: void) {
super(options);
this.name = "WCAG/H36";
}
public setup(): void {
this.on("tag:close", event => {
/* only handle input elements */
......
......@@ -36,7 +36,7 @@ describe("rule h37", () => {
const report = htmlvalidate.validateString("<img>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H37",
"wcag/h37",
'<img> is missing required "alt" attribute'
);
});
......@@ -68,7 +68,7 @@ describe("rule h37", () => {
const report = htmlvalidate.validateString('<img alt="">');
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H37",
"wcag/h37",
'<img> is missing required "alt" attribute'
);
});
......@@ -78,7 +78,7 @@ describe("rule h37", () => {
const report = htmlvalidate.validateString("<img>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H37",
"wcag/h37",
'<img> is missing required "alt" attribute'
);
});
......@@ -110,7 +110,7 @@ describe("rule h37", () => {
const report = htmlvalidate.validateString("<img>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H37",
"wcag/h37",
'<img> is missing required "alt" attribute'
);
});
......
......@@ -23,7 +23,6 @@ class H37 extends Rule<void, RuleOptions> {
public constructor(options: RuleOptions) {
super(Object.assign({}, defaults, options));
this.name = "WCAG/H37";
/* ensure alias is array */
if (!Array.isArray(this.options.alias)) {
......
......@@ -39,7 +39,7 @@ describe("wcag/h67", () => {
const report = htmlvalidate.validateString('<img title="bar">');
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H67",
"wcag/h67",
"<img> with empty alt text cannot have title attribute"
);
});
......@@ -49,7 +49,7 @@ describe("wcag/h67", () => {
const report = htmlvalidate.validateString('<img title="bar">');
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H67",
"wcag/h67",
"<img> with empty alt text cannot have title attribute"
);
});
......
......@@ -10,11 +10,6 @@ class H67 extends Rule {
};
}
public constructor(options: void) {
super(options);
this.name = "WCAG/H67";
}
public setup(): void {
this.on("tag:close", (event: TagCloseEvent) => {
const node = event.target;
......
......@@ -23,7 +23,7 @@ describe("wcag/h71", () => {
const report = htmlvalidate.validateString("<fieldset></fieldset>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H71",
"wcag/h71",
"<fieldset> must have a <legend> as the first child"
);
});
......@@ -33,7 +33,7 @@ describe("wcag/h71", () => {
const report = htmlvalidate.validateString("<custom></custom>");
expect(report).toBeInvalid();
expect(report).toHaveError(
"WCAG/H71",
"wcag/h71",
"<custom> must have a <legend> as the first child"
);
});
......
......@@ -11,11 +11,6 @@ class H71 extends Rule {
};
}
public constructor(options: void) {
super(options);
this.name = "WCAG/H71";
}
public setup(): void {
this.on("dom:ready", (event: DOMReadyEvent) => {
const { document } = event;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment