@sa11y/jest 6.7.1-alpha.3 → 6.7.1-alpha.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"groupViolationResultsProcessor.d.ts","sourceRoot":"","sources":["../src/groupViolationResultsProcessor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AA0JlF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAapF"}
1
+ {"version":3,"file":"groupViolationResultsProcessor.d.ts","sourceRoot":"","sources":["../src/groupViolationResultsProcessor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AAyJlF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAapF"}
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const common_1 = require("@sa11y/common");
4
4
  const format_1 = require("@sa11y/format");
5
- const formatSpacing = ' '.repeat(2);
6
- const formatForError = ' '.repeat(4);
5
+ const formatSpacing = '\t'.repeat(8);
6
+ const formatForAxeMessage = `\n${formatSpacing}\t\t`;
7
7
  const axeMessages = {
8
- toSolveAny: `\n${formatForError}- More Info: To solve the problem, you need to fix at least (1) of the following:\n`,
9
- toSolveFirst: `\n${formatForError}- More Info: To solve the problem, you need to fix one of the following:\n`,
10
- toSolveSecond: `\n${formatForError}- And fix the following:\n`,
8
+ toSolveAny: `${formatForAxeMessage}- More Info: To solve the problem, you need to fix at least (1) of the following:\n`,
9
+ toSolveFirst: `${formatForAxeMessage}- More Info: To solve the problem, you need to fix one of the following:\n`,
10
+ toSolveSecond: `${formatForAxeMessage}- And fix the following:\n`,
11
11
  };
12
12
  /**
13
13
  * Create a test failure html elements array grouped by rule violation
@@ -15,11 +15,11 @@ const axeMessages = {
15
15
  function createA11yErrorElements(errorElements) {
16
16
  const a11yErrorElements = [];
17
17
  errorElements.forEach((errorElement, index) => {
18
- let errorMessage = `${formatForError}(${index + 1}) - HTML element : ${errorElement.html
18
+ let errorMessage = `${formatSpacing}(${index + 1}) - HTML element : ${errorElement.html
19
19
  .replace(/&lt;/g, '<')
20
20
  .replace(/&gt;/, '>')}
21
- ${formatForError}- CSS selector(s) : ${errorElement.selectors.replace(/&gt;/, '>')}
22
- ${formatForError}- HTML Tag Hierarchy : ${errorElement.hierarchy}`;
21
+ - CSS selector(s) : ${errorElement.selectors.replace(/&gt;/, '>')}
22
+ - HTML Tag Hierarchy : ${errorElement.hierarchy}`;
23
23
  if (errorElement.any && errorElement.any.length > 0) {
24
24
  errorMessage += `${axeMessages.toSolveAny}${errorElement.any}`;
25
25
  if (errorElement.all && errorElement.all.length > 0) {
@@ -49,11 +49,10 @@ function createA11yErrorElements(errorElements) {
49
49
  */
50
50
  function createA11yRuleViolation(a11yRule, ruleIndex) {
51
51
  return `(${ruleIndex}) [${a11yRule.id}] ${a11yRule.description}
52
- ${formatSpacing}* Error element(s) : ${a11yRule.errorElements.length}
53
- \n${createA11yErrorElements(a11yRule.errorElements)}
54
- ${formatSpacing}* Help:
55
- ${formatSpacing}${formatSpacing}• Help URL: ${a11yRule.helpUrl}
56
- ${formatSpacing}${formatSpacing}• WCAG Criteria: ${a11yRule.wcagCriteria}`;
52
+ * Error element(s) : ${a11yRule.errorElements.length}\n${createA11yErrorElements(a11yRule.errorElements)}
53
+ * Help:
54
+ - Help URL: ${a11yRule.helpUrl}
55
+ - WCAG Criteria: ${a11yRule.wcagCriteria}`;
57
56
  }
58
57
  /**
59
58
  * Convert any a11y errors from test failures into their own test suite, results
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sa11y/jest",
3
- "version": "6.7.1-alpha.3",
3
+ "version": "6.7.1-alpha.4",
4
4
  "description": "Accessibility testing matcher for Jest",
5
5
  "license": "BSD-3-Clause",
6
6
  "homepage": "https://github.com/salesforce/sa11y/tree/master/packages/jest#readme",
@@ -24,9 +24,9 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@jest/test-result": "^27",
27
- "@sa11y/assert": "6.7.1-alpha.3",
28
- "@sa11y/format": "6.7.1-alpha.3",
29
- "@sa11y/preset-rules": "6.7.1-alpha.3",
27
+ "@sa11y/assert": "6.7.1-alpha.4",
28
+ "@sa11y/format": "6.7.1-alpha.4",
29
+ "@sa11y/preset-rules": "6.7.1-alpha.4",
30
30
  "jest-matcher-utils": "^27"
31
31
  },
32
32
  "peerDependencies": {
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@jest/globals": "28.1.3",
37
- "@sa11y/common": "6.7.1-alpha.3",
38
- "@sa11y/test-utils": "6.7.1-alpha.3"
37
+ "@sa11y/common": "6.7.1-alpha.4",
38
+ "@sa11y/test-utils": "6.7.1-alpha.4"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -43,5 +43,5 @@
43
43
  "engines": {
44
44
  "node": "^16 || ^18"
45
45
  },
46
- "gitHead": "d29edc6690f37bc313d4324b72125d923ce26abd"
46
+ "gitHead": "a44a4a6d189c9d2fc1424891d72a939863a49dd4"
47
47
  }