@faststore/ui 1.3.32 → 1.3.36
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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.3.36 (2021-12-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* expose JS files only ([#1081](https://github.com/vtex/faststore/issues/1081)) ([e363c12](https://github.com/vtex/faststore/commit/e363c120f22b10da81ceb3e2d8fcc58c1b4665af))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.3.35 (2021-12-14)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @faststore/ui
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 1.3.34 (2021-12-11)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **docs:** Fix algolia search ([#1078](https://github.com/vtex/faststore/issues/1078)) ([986074f](https://github.com/vtex/faststore/commit/986074f061365d812650a82748ca5a9fc1dac6d5))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## 1.3.33 (2021-12-10)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @faststore/ui
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## 1.3.32 (2021-12-10)
|
|
7
45
|
|
|
8
46
|
**Note:** Version bump only for package @faststore/ui
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AxeResults } from 'axe-core';
|
|
2
|
+
export declare const toHaveNoIncompletes: {
|
|
3
|
+
toHaveNoIncompletes: (results: AxeResults) => {
|
|
4
|
+
actual: import("axe-core").Result[];
|
|
5
|
+
message: () => string;
|
|
6
|
+
pass: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare global {
|
|
10
|
+
namespace jest {
|
|
11
|
+
interface Matchers<R> {
|
|
12
|
+
toHaveNoIncompletes(): R;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
interface Node {
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.36",
|
|
4
4
|
"description": "A lightweight, framework agnostic component library for React",
|
|
5
5
|
"author": "emersonlaurentino",
|
|
6
6
|
"license": "MIT",
|
|
@@ -72,12 +72,15 @@
|
|
|
72
72
|
"@testing-library/react": "^11.2.6",
|
|
73
73
|
"@testing-library/react-hooks": "^7.0.2",
|
|
74
74
|
"@testing-library/user-event": "^13.1.8",
|
|
75
|
+
"@types/axe-core": "^2.0.7",
|
|
75
76
|
"@types/jest-axe": "^3.5.3",
|
|
76
77
|
"@types/tabbable": "^3.1.1",
|
|
77
78
|
"@types/testing-library__jest-dom": "^5.9.5",
|
|
78
|
-
"@vtex/theme-b2c-tailwind": "^1.3.
|
|
79
|
+
"@vtex/theme-b2c-tailwind": "^1.3.36",
|
|
79
80
|
"@vtex/tsconfig": "^0.5.0",
|
|
81
|
+
"chalk": "^5.0.0",
|
|
80
82
|
"jest-axe": "^5.0.1",
|
|
83
|
+
"jest-matcher-utils": "^27.4.2",
|
|
81
84
|
"react": "^17.0.2",
|
|
82
85
|
"react-docgen-typescript-loader": "^3.7.2",
|
|
83
86
|
"react-dom": "^17.0.2",
|
|
@@ -86,5 +89,5 @@
|
|
|
86
89
|
"tsdx": "^0.14.1",
|
|
87
90
|
"typescript": "^4.2.4"
|
|
88
91
|
},
|
|
89
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "2f5c0a0e8c49b2c0ff9bed247645915deb8e18ae"
|
|
90
93
|
}
|
|
@@ -76,6 +76,14 @@ describe('Modal WAI-ARIA Specifications', () => {
|
|
|
76
76
|
)
|
|
77
77
|
|
|
78
78
|
expect(await axe(document.body)).toHaveNoViolations()
|
|
79
|
+
// This is disabled because the useTrapFocus use sentinel div elements
|
|
80
|
+
// with tabindex and aria-hidden true. This is intentionally, because
|
|
81
|
+
// these divs shouldn't be considered to accessibility API.
|
|
82
|
+
expect(
|
|
83
|
+
await axe(document.body, {
|
|
84
|
+
rules: { 'aria-hidden-focus': { enabled: false } },
|
|
85
|
+
})
|
|
86
|
+
).toHaveNoIncompletes()
|
|
79
87
|
})
|
|
80
88
|
|
|
81
89
|
it('Focus first element', () => {
|
package/src/setupTests.ts
CHANGED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { AxeResults } from 'axe-core'
|
|
2
|
+
import { printReceived, matcherHint } from 'jest-matcher-utils'
|
|
3
|
+
import chalk from 'chalk'
|
|
4
|
+
|
|
5
|
+
// This code is based on jest-axe library.
|
|
6
|
+
// https://github.com/nickcolley/jest-axe
|
|
7
|
+
export const toHaveNoIncompletes = {
|
|
8
|
+
toHaveNoIncompletes: (results: AxeResults) => {
|
|
9
|
+
if (typeof results.incomplete === 'undefined') {
|
|
10
|
+
throw new Error('No incompletes found in aXe results object')
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const reporter = (incompletes: AxeResults['incomplete']) => {
|
|
14
|
+
if (incompletes.length === 0) {
|
|
15
|
+
return []
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const lineBreak = '\n\n'
|
|
19
|
+
const horizontalLine = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500'
|
|
20
|
+
|
|
21
|
+
return incompletes
|
|
22
|
+
.map((incomplete) => {
|
|
23
|
+
const errorBody = incomplete.nodes
|
|
24
|
+
.map((node) => {
|
|
25
|
+
const selector = node.target.join(', ')
|
|
26
|
+
const expectedText = `Expected the HTML found at $('${selector}') to have no incompletes:${lineBreak}`
|
|
27
|
+
|
|
28
|
+
return `${
|
|
29
|
+
expectedText + chalk.grey(node.html) + lineBreak
|
|
30
|
+
}Received:${lineBreak}${printReceived(
|
|
31
|
+
`${incomplete.help} (${incomplete.id})`
|
|
32
|
+
)}${lineBreak}${chalk.yellow(node.failureSummary)}${lineBreak}${
|
|
33
|
+
incomplete.helpUrl
|
|
34
|
+
? `You can find more information on this issue here: \n${chalk.blue(
|
|
35
|
+
incomplete.helpUrl
|
|
36
|
+
)}`
|
|
37
|
+
: ''
|
|
38
|
+
}`
|
|
39
|
+
})
|
|
40
|
+
.join(lineBreak)
|
|
41
|
+
|
|
42
|
+
return errorBody
|
|
43
|
+
})
|
|
44
|
+
.join(lineBreak + horizontalLine + lineBreak)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const { incomplete: incompletes } = results
|
|
48
|
+
const formatedIncompletes = reporter(incompletes)
|
|
49
|
+
const pass = formatedIncompletes.length === 0
|
|
50
|
+
|
|
51
|
+
const message = () => {
|
|
52
|
+
if (pass) {
|
|
53
|
+
return ''
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
`${matcherHint('.toHaveNoIncompletes')}\n\n` + `${formatedIncompletes}`
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return { actual: incompletes, message, pass }
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare global {
|
|
66
|
+
// eslint-disable-next-line
|
|
67
|
+
namespace jest {
|
|
68
|
+
interface Matchers<R> {
|
|
69
|
+
toHaveNoIncompletes(): R
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// axe-core depends on a global Node
|
|
74
|
+
// eslint-disable-next-line
|
|
75
|
+
interface Node {}
|
|
76
|
+
}
|