@uuv/a11y 1.0.0-beta.8 → 1.0.0-beta.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +756 -0
  2. package/LICENSE +0 -2
  3. package/README.md +21 -7
  4. package/bundle/uuv-a11y.bundle.js +2 -2
  5. package/bundle/uuv-a11y.bundle.js.LICENSE.txt +12 -0
  6. package/dist/CHANGELOG.md +748 -0
  7. package/dist/README.md +21 -7
  8. package/dist/lib/model/checker.d.ts +3 -12
  9. package/dist/lib/model/checker.js +0 -33
  10. package/dist/lib/model/checklist-checker.d.ts +15 -0
  11. package/dist/lib/model/checklist-checker.js +61 -0
  12. package/dist/lib/model/index.d.ts +1 -0
  13. package/dist/lib/model/index.js +1 -0
  14. package/dist/lib/model/reference.js +1 -1
  15. package/dist/lib/model/result.js +1 -1
  16. package/dist/lib/model/rule.d.ts +8 -8
  17. package/dist/lib/model/rule.js +3 -3
  18. package/dist/lib/model/uuv-a11y-result.d.ts +54 -0
  19. package/dist/lib/model/uuv-a11y-result.js +17 -0
  20. package/dist/lib/query/accessible-name.query.d.ts +2 -0
  21. package/dist/lib/query/accessible-name.query.js +8 -2
  22. package/dist/lib/query/compliant-attributes/attribut-specification.d.ts +9 -0
  23. package/dist/lib/query/compliant-attributes/attribut-specification.js +29 -4
  24. package/dist/lib/query/compliant-attributes/attribute-checker.d.ts +12 -0
  25. package/dist/lib/query/compliant-attributes/attribute-checker.js +18 -0
  26. package/dist/lib/reference/index.d.ts +1 -0
  27. package/dist/lib/reference/index.js +1 -0
  28. package/dist/lib/reference/rgaa/coverage/coverage-helper.js +18 -9
  29. package/dist/lib/reference/rgaa/coverage/coverage-statement.json +22 -3
  30. package/dist/lib/reference/rgaa/rgaa-checker.d.ts +3 -3
  31. package/dist/lib/reference/rgaa/rgaa-checker.js +2 -2
  32. package/dist/lib/reference/rgaa/rules/1-image.d.ts +4 -4
  33. package/dist/lib/reference/rgaa/rules/11-form.d.ts +4 -4
  34. package/dist/lib/reference/rgaa/rules/2-frame.d.ts +4 -4
  35. package/dist/lib/reference/rgaa/rules/3-color.d.ts +4 -4
  36. package/dist/lib/reference/rgaa/rules/5-table.d.ts +4 -4
  37. package/dist/lib/reference/rgaa/rules/6-link.d.ts +12 -1
  38. package/dist/lib/reference/rgaa/rules/6-link.js +147 -1
  39. package/dist/lib/reference/rgaa/rules/8-required-element.d.ts +4 -4
  40. package/dist/lib/reference/rgaa/rules/8-required-element.js +57 -3
  41. package/dist/lib/reference/wcag/index.d.ts +1 -0
  42. package/dist/lib/reference/wcag/index.js +17 -0
  43. package/dist/lib/reference/wcag/wcag-checker.d.ts +14 -0
  44. package/dist/lib/reference/wcag/wcag-checker.js +86 -0
  45. package/dist/lib/reference/wcag/wcag-helper.d.ts +9 -0
  46. package/dist/lib/reference/wcag/wcag-helper.js +73 -0
  47. package/dist/package.json +20 -14
  48. package/package.json +18 -12
package/dist/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
2
  # @uuv/a11y
3
3
  <div align="center">
4
- <a href="https://orange-opensource.github.io/uuv/">
4
+ <a href="https://e2e-test-quest.github.io/uuv/">
5
5
  <picture>
6
- <img alt="UUV Logo" src="https://orange-opensource.github.io/uuv/img/uuv.png">
6
+ <img alt="UUV Logo" src="https://e2e-test-quest.github.io/uuv/img/uuv.png">
7
7
  </picture>
8
8
  </a>
9
9
  </div>
@@ -70,7 +70,7 @@ For each criterion of the RGAA, the following algorithm is executed :
70
70
 
71
71
  ![Diagram a11Y RGAA](https://unpkg.com/@uuv/a11y/docs/diagram-a11y-rgaa.png)
72
72
 
73
- **Consult [this page](https://orange-opensource.github.io/uuv/docs/tools/uuv-a11y#rgaa) to find out which RGAA verifications are implemented in the library**
73
+ **Consult [this page](https://e2e-test-quest.github.io/uuv/docs/tools/uuv-a11y#rgaa) to find out which RGAA verifications are implemented in the library**
74
74
  </p>
75
75
 
76
76
  ## Usage
@@ -156,22 +156,36 @@ For each criterion of the RGAA, the following algorithm is executed :
156
156
  }
157
157
  """
158
158
  ```
159
- You can also see the [French example](https://github.com/Orange-OpenSource/uuv/blob/main/example/fr-rgaa.feature) or the complete [English example](https://github.com/Orange-OpenSource/uuv/blob/main/example/en-rgaa.feature).
159
+ You can also see the [French example](https://github.com/e2e-test-quest/uuv/blob/main/example/fr-rgaa.feature) or the complete [English example](https://github.com/e2e-test-quest/uuv/blob/main/example/en-rgaa.feature).
160
160
  3. Then execute your tests :
161
161
  ```shell
162
162
  npx uuv e2e
163
163
  ```
164
164
 
165
165
  ## Want to contribute ?
166
- Your help is welcome, see the [Contributors guide](https://github.com/Orange-OpenSource/uuv/blob/main/packages/a11y/CONTRIBUTING.md).
166
+ Your help is welcome, see the [Contributors guide](https://github.com/e2e-test-quest/uuv/blob/main/packages/a11y/CONTRIBUTING.md).
167
167
 
168
168
  ## License
169
169
 
170
- [<a href="https://github.com/Orange-OpenSource/uuv/blob/main/LICENSE">
170
+ [<a href="https://github.com/e2e-test-quest/uuv/blob/main/LICENSE">
171
171
  <img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"/>
172
172
  </a>](https://spdx.org/licenses/MIT.html)
173
173
 
174
- This project is licensed under the terms of the [MIT license](https://github.com/Orange-OpenSource/uuv/blob/main/LICENSE).
174
+ This project is licensed under the terms of the [MIT license](https://github.com/e2e-test-quest/uuv/blob/main/LICENSE).
175
+
176
+ ## Support UUV through Open Collective
177
+
178
+ If you want to help UUV grow, you can fund the project directly via [Open Collective](https://opencollective.com/uuv).
179
+ Every contribution helps us dedicate more time and energy to improving this open-source tool.
180
+
181
+ <a href="https://opencollective.com/uuv/contribute" target="_blank">
182
+ <img src="https://opencollective.com/uuv/contribute/button@2x.png?color=blue" width=300 />
183
+ </a>
184
+
185
+
186
+ Interested in becoming a sponsor?
187
+ We welcome sponsorships of all sizes!
188
+ Contact us via [GitHub](https://github.com/e2e-test-quest/uuv/discussions) or through [Open Collective](https://opencollective.com/uuv) to discuss opportunities.
175
189
 
176
190
  ## Authors
177
191
 
@@ -1,14 +1,5 @@
1
- import { A11yReference } from "./reference";
2
1
  import { Observable } from "rxjs";
3
- import { A11yResult } from "./result";
4
- import { A11yRule } from "./rule";
5
- import { Engine } from "../engine/engine";
6
- export declare abstract class A11yChecker {
7
- readonly url: string;
8
- readonly engine: Engine;
9
- readonly reference: A11yReference;
10
- protected constructor(url: string, engine: Engine, reference: A11yReference);
11
- abstract rules(): A11yRule[];
12
- validate(): Observable<A11yResult>;
13
- private buildCheckList;
2
+ import { UuvA11yResultUsecase, UuvA11yResultUsecaseLocation } from "./uuv-a11y-result";
3
+ export interface A11yChecker {
4
+ validate(name: string, script: string, location: UuvA11yResultUsecaseLocation): Observable<UuvA11yResultUsecase>;
14
5
  }
@@ -1,35 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.A11yChecker = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const result_1 = require("./result");
6
- class A11yChecker {
7
- url;
8
- engine;
9
- reference;
10
- constructor(url, engine, reference) {
11
- this.url = url;
12
- this.engine = engine;
13
- this.reference = reference;
14
- }
15
- validate() {
16
- const result = new result_1.A11yResult(this.url, this.reference);
17
- const rules = this.rules();
18
- const checkList = this.buildCheckList(rules);
19
- return (0, rxjs_1.forkJoin)(checkList)
20
- .pipe((0, rxjs_1.map)((ruleResults) => {
21
- result.ruleResults = ruleResults;
22
- result.computeStatus();
23
- return result;
24
- }), (0, rxjs_1.tap)(result => {
25
- console.debug("result");
26
- console.debug(result);
27
- }));
28
- }
29
- buildCheckList(rules) {
30
- const checkList = [];
31
- rules.forEach(rule => checkList.push(this.engine.buildCheckListItemFromRule(rule)));
32
- return checkList;
33
- }
34
- }
35
- exports.A11yChecker = A11yChecker;
@@ -0,0 +1,15 @@
1
+ import { A11yReference } from "./reference";
2
+ import { Observable } from "rxjs";
3
+ import { A11yRule } from "./rule";
4
+ import { Engine } from "../engine/engine";
5
+ import { A11yChecker } from "./checker";
6
+ import { UuvA11yResultUsecase, UuvA11yResultUsecaseLocation } from "./uuv-a11y-result";
7
+ export declare abstract class A11yChecklistChecker implements A11yChecker {
8
+ readonly url: string;
9
+ readonly engine: Engine;
10
+ readonly reference: A11yReference;
11
+ protected constructor(url: string, engine: Engine, reference: A11yReference);
12
+ abstract rules(): A11yRule[];
13
+ validate(name: string, script: string, location: UuvA11yResultUsecaseLocation): Observable<UuvA11yResultUsecase>;
14
+ private buildCheckList;
15
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.A11yChecklistChecker = void 0;
4
+ const reference_1 = require("./reference");
5
+ const rxjs_1 = require("rxjs");
6
+ const result_1 = require("./result");
7
+ const uuv_a11y_result_1 = require("./uuv-a11y-result");
8
+ class A11yChecklistChecker {
9
+ url;
10
+ engine;
11
+ reference;
12
+ constructor(url, engine, reference) {
13
+ this.url = url;
14
+ this.engine = engine;
15
+ this.reference = reference;
16
+ }
17
+ validate(name, script, location) {
18
+ const result = new result_1.A11yResult(this.url, this.reference);
19
+ const rules = this.rules();
20
+ const checkList = this.buildCheckList(rules);
21
+ return (0, rxjs_1.forkJoin)(checkList)
22
+ .pipe((0, rxjs_1.map)((ruleResults) => {
23
+ result.ruleResults = ruleResults;
24
+ result.computeStatus();
25
+ const issues = ruleResults.map(ruleResult => {
26
+ return {
27
+ type: uuv_a11y_result_1.IssueType.Error,
28
+ code: ruleResult.rule.id,
29
+ message: ruleResult.rule.description || "",
30
+ selector: ruleResult.getErrorNodes().map(error => error.selector).join(", "),
31
+ runnerExtras: {
32
+ rule: ruleResult.rule,
33
+ validations: ruleResult.validations,
34
+ errorNodes: ruleResult.getErrorNodes()
35
+ }
36
+ };
37
+ });
38
+ return {
39
+ name,
40
+ script,
41
+ location,
42
+ result: {
43
+ date: (new Date()).getTime(),
44
+ reference: reference_1.A11yReferenceEnum.WCAG_WEB,
45
+ issues,
46
+ rawResult: result,
47
+ status: result.status
48
+ },
49
+ };
50
+ }), (0, rxjs_1.tap)(result => {
51
+ console.debug("result");
52
+ console.debug(result);
53
+ }));
54
+ }
55
+ buildCheckList(rules) {
56
+ const checkList = [];
57
+ rules.forEach(rule => checkList.push(this.engine.buildCheckListItemFromRule(rule)));
58
+ return checkList;
59
+ }
60
+ }
61
+ exports.A11yChecklistChecker = A11yChecklistChecker;
@@ -1,4 +1,5 @@
1
1
  export * from "./reference";
2
2
  export * from "./checker";
3
3
  export * from "./result";
4
+ export * from "./uuv-a11y-result";
4
5
  export * from "./rule";
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./reference"), exports);
18
18
  __exportStar(require("./checker"), exports);
19
19
  __exportStar(require("./result"), exports);
20
+ __exportStar(require("./uuv-a11y-result"), exports);
20
21
  __exportStar(require("./rule"), exports);
@@ -7,7 +7,7 @@ var A11yReferenceEnum;
7
7
  A11yReferenceEnum["WCAG_WEB"] = "WCAG-WEB";
8
8
  A11yReferenceEnum["WCAG_ANDROID"] = "WCAG-ANDROID";
9
9
  A11yReferenceEnum["WCAG_IOS"] = "WCAG-IOS";
10
- })(A11yReferenceEnum = exports.A11yReferenceEnum || (exports.A11yReferenceEnum = {}));
10
+ })(A11yReferenceEnum || (exports.A11yReferenceEnum = A11yReferenceEnum = {}));
11
11
  class Comments {
12
12
  info;
13
13
  warning;
@@ -7,7 +7,7 @@ var A11yResultStatus;
7
7
  A11yResultStatus["SUCCESS"] = "success";
8
8
  A11yResultStatus["MANUAL"] = "manual";
9
9
  A11yResultStatus["ERROR"] = "error";
10
- })(A11yResultStatus = exports.A11yResultStatus || (exports.A11yResultStatus = {}));
10
+ })(A11yResultStatus || (exports.A11yResultStatus = A11yResultStatus = {}));
11
11
  class A11yRuleValidationResult {
12
12
  criteria;
13
13
  status = A11yResultStatus.UNKNOWN;
@@ -33,15 +33,15 @@ export declare class AutoCheckA11yRule implements A11yRule {
33
33
  help?: string | string[];
34
34
  shouldNotExist?: boolean;
35
35
  }): AutoCheckA11yRule & {
36
- attributes?: string[] | undefined;
36
+ attributes?: string[];
37
37
  criterion: string;
38
38
  wcag: string;
39
39
  id: string;
40
40
  elementType: string;
41
41
  query: Query;
42
- description?: string | undefined;
43
- help?: string | string[] | undefined;
44
- shouldNotExist?: boolean | undefined;
42
+ description?: string;
43
+ help?: string | string[];
44
+ shouldNotExist?: boolean;
45
45
  };
46
46
  }
47
47
  export declare class ManualCheckA11yRule implements A11yRule {
@@ -66,15 +66,15 @@ export declare class ManualCheckA11yRule implements A11yRule {
66
66
  help?: string;
67
67
  shouldNotExist?: boolean;
68
68
  }): ManualCheckA11yRule & {
69
- attributes?: string[] | undefined;
69
+ attributes?: string[];
70
70
  criterion: string;
71
71
  wcag: string;
72
72
  id: string;
73
73
  elementType: string;
74
74
  query: Query;
75
- description?: string | undefined;
76
- help?: string | undefined;
77
- shouldNotExist?: boolean | undefined;
75
+ description?: string;
76
+ help?: string;
77
+ shouldNotExist?: boolean;
78
78
  };
79
79
  }
80
80
  export declare enum RuleCheckEnum {
@@ -37,15 +37,15 @@ var RuleCheckEnum;
37
37
  (function (RuleCheckEnum) {
38
38
  RuleCheckEnum["MANUAL"] = "MANUAL";
39
39
  RuleCheckEnum["AUTO"] = "AUTO";
40
- })(RuleCheckEnum = exports.RuleCheckEnum || (exports.RuleCheckEnum = {}));
40
+ })(RuleCheckEnum || (exports.RuleCheckEnum = RuleCheckEnum = {}));
41
41
  var CustomFilter;
42
42
  (function (CustomFilter) {
43
43
  CustomFilter["DOCTYPE"] = "$DOCTYPE";
44
44
  CustomFilter["FORM_FIELD"] = "$FORMFIELD";
45
- })(CustomFilter = exports.CustomFilter || (exports.CustomFilter = {}));
45
+ })(CustomFilter || (exports.CustomFilter = CustomFilter = {}));
46
46
  var RuleTypeEnum;
47
47
  (function (RuleTypeEnum) {
48
48
  RuleTypeEnum["TAG"] = "TAG";
49
49
  RuleTypeEnum["ROLE"] = "ROLE";
50
50
  RuleTypeEnum["COLOR"] = "COLOR";
51
- })(RuleTypeEnum = exports.RuleTypeEnum || (exports.RuleTypeEnum = {}));
51
+ })(RuleTypeEnum || (exports.RuleTypeEnum = RuleTypeEnum = {}));
@@ -0,0 +1,54 @@
1
+ import { A11yReferenceEnum } from "./reference";
2
+ import { A11yResultStatus } from "./result";
3
+ export declare enum IssueType {
4
+ Warning = "warning",
5
+ Error = "error",
6
+ Notice = "notice"
7
+ }
8
+ export type UuvA11yResultApp = {
9
+ name: string;
10
+ description: string;
11
+ usecases: UuvA11yResultUsecase[];
12
+ };
13
+ export type UuvA11yResultUsecase = {
14
+ name: string;
15
+ script: string;
16
+ location: UuvA11yResultUsecaseLocation;
17
+ result: UuvA11yResultExecution;
18
+ };
19
+ export type UuvA11yResultUsecaseLocation = {
20
+ file: string;
21
+ line: number;
22
+ column: number;
23
+ };
24
+ export type UuvA11yResultExecution = {
25
+ date: number;
26
+ reference: A11yReferenceEnum;
27
+ issues: AccessibilityIssue[];
28
+ status: A11yResultStatus;
29
+ rawResult?: any;
30
+ };
31
+ export type AccessibilityIssue = {
32
+ type: IssueType;
33
+ code: string;
34
+ message: string;
35
+ selector: string;
36
+ htmlElement?: Element | null;
37
+ runnerExtras: RunnerExtras | any;
38
+ };
39
+ export type RunnerExtras = {
40
+ description: string;
41
+ impact: IssueImpact;
42
+ help: string;
43
+ helpUrl: string;
44
+ };
45
+ export declare enum IssueImpact {
46
+ Minor = "minor",
47
+ Moderate = "moderate",
48
+ Serious = "serious",
49
+ Critical = "critical",
50
+ Unknown = "unknown"
51
+ }
52
+ export type UuvA11yResult = {
53
+ app: UuvA11yResultApp;
54
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IssueImpact = exports.IssueType = void 0;
4
+ var IssueType;
5
+ (function (IssueType) {
6
+ IssueType["Warning"] = "warning";
7
+ IssueType["Error"] = "error";
8
+ IssueType["Notice"] = "notice";
9
+ })(IssueType || (exports.IssueType = IssueType = {}));
10
+ var IssueImpact;
11
+ (function (IssueImpact) {
12
+ IssueImpact["Minor"] = "minor";
13
+ IssueImpact["Moderate"] = "moderate";
14
+ IssueImpact["Serious"] = "serious";
15
+ IssueImpact["Critical"] = "critical";
16
+ IssueImpact["Unknown"] = "unknown";
17
+ })(IssueImpact || (exports.IssueImpact = IssueImpact = {}));
@@ -4,5 +4,7 @@ export declare class AccessibleNameQuery implements Query {
4
4
  readonly shouldBeEmpty: boolean;
5
5
  constructor(subQuery: Query, shouldBeEmpty: boolean);
6
6
  execute(): QueryResult[];
7
+ private isNullOrEmpty;
8
+ private isNotNullAndNotEmpty;
7
9
  getSelector(): string;
8
10
  }
@@ -13,10 +13,10 @@ class AccessibleNameQuery {
13
13
  execute() {
14
14
  return this.subQuery.execute().filter(element => {
15
15
  const accessibleName = (0, dom_accessibility_api_1.computeAccessibleName)(element.domNode);
16
- if (this.shouldBeEmpty && (0, lodash_1.isEmpty)(accessibleName)) {
16
+ if (this.shouldBeEmpty && this.isNullOrEmpty(accessibleName)) {
17
17
  return true;
18
18
  }
19
- else if (!this.shouldBeEmpty && !(0, lodash_1.isEmpty)(accessibleName)) {
19
+ else if (!this.shouldBeEmpty && this.isNotNullAndNotEmpty(accessibleName)) {
20
20
  return true;
21
21
  }
22
22
  else {
@@ -24,6 +24,12 @@ class AccessibleNameQuery {
24
24
  }
25
25
  });
26
26
  }
27
+ isNullOrEmpty(accessibleName) {
28
+ return (0, lodash_1.isNull)(accessibleName) || (0, lodash_1.isEmpty)(accessibleName);
29
+ }
30
+ isNotNullAndNotEmpty(accessibleName) {
31
+ return !(0, lodash_1.isNull)(accessibleName) && !(0, lodash_1.isEmpty)(accessibleName);
32
+ }
27
33
  getSelector() {
28
34
  return `AccessibleName: ${this.subQuery.getSelector()}`;
29
35
  }
@@ -23,3 +23,12 @@ export declare class EqualsAttributeSpecification implements IAttributeSpecifica
23
23
  constructor(expectedValueList: string[]);
24
24
  isSatisfiedBy(element: HTMLElement, attributeName: string): boolean;
25
25
  }
26
+ export declare class AccessibleNameNotContainsVisibleTextSpecification implements IAttributeSpecification {
27
+ isSatisfiedBy(element: HTMLElement, attributeName: string): boolean;
28
+ }
29
+ export declare class EmptyInnerTextSpecification implements IAttributeSpecification {
30
+ isSatisfiedBy(element: HTMLElement, attributeName: string): boolean;
31
+ }
32
+ export declare class NotEmptyInnerTextSpecification implements IAttributeSpecification {
33
+ isSatisfiedBy(element: HTMLElement, attributeName: string): boolean;
34
+ }
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EqualsAttributeSpecification = exports.NotEqualsAttributeSpecification = exports.NotUniqueIdAttributeSpecification = exports.EmptyElementWithIdSpecification = exports.NotEmptyAttributeSpecification = exports.EmptyAttributeSpecification = void 0;
6
+ exports.NotEmptyInnerTextSpecification = exports.EmptyInnerTextSpecification = exports.AccessibleNameNotContainsVisibleTextSpecification = exports.EqualsAttributeSpecification = exports.NotEqualsAttributeSpecification = exports.NotUniqueIdAttributeSpecification = exports.EmptyElementWithIdSpecification = exports.NotEmptyAttributeSpecification = exports.EmptyAttributeSpecification = void 0;
7
7
  const lodash_1 = __importDefault(require("lodash"));
8
8
  // eslint-disable-next-line @typescript-eslint/no-var-requires
9
9
  const $ = require("jquery/dist/jquery.min");
10
+ const dom_accessibility_api_1 = require("dom-accessibility-api");
10
11
  class EmptyAttributeSpecification {
11
12
  isSatisfiedBy(element, attributeName) {
12
13
  const attributeValue = element.getAttribute(attributeName);
@@ -24,7 +25,7 @@ exports.NotEmptyAttributeSpecification = NotEmptyAttributeSpecification;
24
25
  class EmptyElementWithIdSpecification {
25
26
  isSatisfiedBy(element, attributeName) {
26
27
  const attributeValue = element.getAttribute(attributeName);
27
- if (lodash_1.default.isEmpty(attributeValue) || lodash_1.default.isNull(attributeValue)) {
28
+ if (attributeValue === null || lodash_1.default.isEmpty(attributeValue)) {
28
29
  return true;
29
30
  }
30
31
  const bindingNodeId = $(`#${attributeValue.replaceAll(".", "\\.")}`).text();
@@ -48,7 +49,7 @@ class NotEqualsAttributeSpecification {
48
49
  }
49
50
  isSatisfiedBy(element, attributeName) {
50
51
  const attributeValue = element.getAttribute(attributeName);
51
- if (lodash_1.default.isNull(attributeValue)) {
52
+ if (attributeValue === null) {
52
53
  return true;
53
54
  }
54
55
  return !this.expectedValueList.includes(attributeValue);
@@ -62,10 +63,34 @@ class EqualsAttributeSpecification {
62
63
  }
63
64
  isSatisfiedBy(element, attributeName) {
64
65
  const attributeValue = element.getAttribute(attributeName);
65
- if (lodash_1.default.isNull(attributeValue)) {
66
+ if (attributeValue === null) {
66
67
  return false;
67
68
  }
68
69
  return this.expectedValueList.includes(attributeValue);
69
70
  }
70
71
  }
71
72
  exports.EqualsAttributeSpecification = EqualsAttributeSpecification;
73
+ class AccessibleNameNotContainsVisibleTextSpecification {
74
+ isSatisfiedBy(element, attributeName) {
75
+ const visibleText = element.textContent;
76
+ if (visibleText === null || lodash_1.default.isEmpty(visibleText)) {
77
+ return false;
78
+ }
79
+ const accessibleName = (0, dom_accessibility_api_1.computeAccessibleName)(element);
80
+ console.debug("visibleText", visibleText, "accessibleName", accessibleName);
81
+ return accessibleName?.toLowerCase().indexOf(visibleText.toLowerCase()) === -1;
82
+ }
83
+ }
84
+ exports.AccessibleNameNotContainsVisibleTextSpecification = AccessibleNameNotContainsVisibleTextSpecification;
85
+ class EmptyInnerTextSpecification {
86
+ isSatisfiedBy(element, attributeName) {
87
+ return lodash_1.default.isEmpty(element.textContent);
88
+ }
89
+ }
90
+ exports.EmptyInnerTextSpecification = EmptyInnerTextSpecification;
91
+ class NotEmptyInnerTextSpecification {
92
+ isSatisfiedBy(element, attributeName) {
93
+ return !lodash_1.default.isEmpty(element.textContent);
94
+ }
95
+ }
96
+ exports.NotEmptyInnerTextSpecification = NotEmptyInnerTextSpecification;
@@ -32,4 +32,16 @@ export declare class AttributeChecker {
32
32
  * Check that html element have the expected value
33
33
  */
34
34
  static equals(attributeName: string, expectedValueList: string[]): CompliantSpecification;
35
+ /**
36
+ * Check that html element accessible name contains visible text ignoring case
37
+ */
38
+ static accessibleNameNotContainsVisibleText(): CompliantSpecification;
39
+ /**
40
+ * Check that html element have empty text
41
+ */
42
+ static emptyText(): CompliantSpecification;
43
+ /**
44
+ * Check that html element have not empty text
45
+ */
46
+ static notEmptyText(): CompliantSpecification;
35
47
  }
@@ -51,5 +51,23 @@ class AttributeChecker {
51
51
  static equals(attributeName, expectedValueList) {
52
52
  return new CompliantSpecification(attributeName, new attribut_specification_1.EqualsAttributeSpecification(expectedValueList));
53
53
  }
54
+ /**
55
+ * Check that html element accessible name contains visible text ignoring case
56
+ */
57
+ static accessibleNameNotContainsVisibleText() {
58
+ return new CompliantSpecification("accessibleName", new attribut_specification_1.AccessibleNameNotContainsVisibleTextSpecification());
59
+ }
60
+ /**
61
+ * Check that html element have empty text
62
+ */
63
+ static emptyText() {
64
+ return new CompliantSpecification("text", new attribut_specification_1.EmptyInnerTextSpecification());
65
+ }
66
+ /**
67
+ * Check that html element have not empty text
68
+ */
69
+ static notEmptyText() {
70
+ return new CompliantSpecification("text", new attribut_specification_1.NotEmptyInnerTextSpecification());
71
+ }
54
72
  }
55
73
  exports.AttributeChecker = AttributeChecker;
@@ -1 +1,2 @@
1
1
  export * from "./rgaa";
2
+ export * from "./wcag";
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // export * from './alix';
18
18
  __exportStar(require("./rgaa"), exports);
19
+ __exportStar(require("./wcag"), exports);
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.buildCoverage = void 0;
36
+ exports.buildCoverage = buildCoverage;
27
37
  const model_1 = require("../../../model");
28
38
  const PARTIAL_COVERAGE = __importStar(require("./coverage-statement.json"));
29
39
  const common_1 = require("../common");
@@ -97,4 +107,3 @@ function buildCoverage() {
97
107
  });
98
108
  return referenceCoverage;
99
109
  }
100
- exports.buildCoverage = buildCoverage;
@@ -21,7 +21,24 @@
21
21
  "5.7.3",
22
22
  "5.7.4",
23
23
  "5.7.5",
24
- "5.8.1"
24
+ "5.8.1",
25
+ "6.1.1",
26
+ "6.1.2",
27
+ "6.1.3",
28
+ "6.1.4",
29
+ "6.1.5",
30
+ "6.2.1",
31
+ "8.1.1",
32
+ "8.1.2",
33
+ "8.1.3",
34
+ "8.3.1",
35
+ "8.4.1",
36
+ "8.5.1",
37
+ "8.6.1",
38
+ "8.7.1",
39
+ "8.8.1",
40
+ "8.10.1",
41
+ "8.10.2"
25
42
  ],
26
43
  "inProgress": [
27
44
  "1.1.4",
@@ -57,7 +74,9 @@
57
74
  "1.6.4",
58
75
  "1.6.5",
59
76
  "1.6.6",
60
- "1.6.7"
77
+ "1.6.7",
78
+ "8.2.1",
79
+ "8.9.1"
61
80
  ],
62
81
  "wontBeImplemented": [
63
82
  "1.1.6"
@@ -104,7 +123,7 @@
104
123
  "warning": "Pour les contrôles concernant les alternatives textuelles, nous utilisons la librairie [dom-accessibility-api](https://www.npmjs.com/package/dom-accessibility-api) qui implémente les [règles du W3C](https://w3c.github.io/accname/)"
105
124
  },
106
125
  "5": {
107
- "warning": "Nous considérons qu'un *tableau de mise en forme* est une balise *table* possédant le rôle *presentation* \\\n Nous considérons qu'un *tableau avec header* est une balise *table* ou un rôle table possédant une balise *th* ou un élément avec un rôle *rowheader* ou un élément avec un rôle *columnheader*"
126
+ "warning": "Nous considérons qu'un *tableau de mise en forme* est une balise *table* possédant le rôle *presentation* \\\n Nous considérons qu'un *tableau avec header* est une balise *table* ou un rôle *table* possédant une balise *th* ou un élément avec un rôle *rowheader* ou un élément avec un rôle *columnheader*"
108
127
  }
109
128
  }
110
129
  }
@@ -1,8 +1,8 @@
1
1
  import { Observable } from "rxjs";
2
- import { A11yChecker } from "../../model";
3
- export declare class RgaaChecker extends A11yChecker {
2
+ import { A11yChecklistChecker } from "../../model/checklist-checker";
3
+ export declare class RgaaChecker extends A11yChecklistChecker {
4
4
  emitter: Observable<boolean>;
5
5
  constructor(url: string, enabledRules?: string[]);
6
6
  private focusOnEnabledRules;
7
- rules(): import("../../model").A11yRule[];
7
+ rules(): import("../..").A11yRule[];
8
8
  }
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RgaaChecker = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
- const model_1 = require("../../model");
6
5
  const engine_1 = require("../../engine/engine");
7
6
  const rgaa_reference_1 = require("./rgaa-reference");
8
- class RgaaChecker extends model_1.A11yChecker {
7
+ const checklist_checker_1 = require("../../model/checklist-checker");
8
+ class RgaaChecker extends checklist_checker_1.A11yChecklistChecker {
9
9
  emitter = new rxjs_1.Observable();
10
10
  constructor(url, enabledRules) {
11
11
  super(url, new engine_1.Engine(url, rgaa_reference_1.A11Y_RGAA_REFERENCE), rgaa_reference_1.A11Y_RGAA_REFERENCE);