@elliemae/ds-test-utils 3.16.0 → 3.16.1-rc.10
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/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/testeable-utils/DSVirtualList.js +4 -0
- package/dist/cjs/testeable-utils/DSVirtualList.js.map +1 -1
- package/dist/cjs/testeable-utils/axe-core/getMessageAndPass.js +5 -1
- package/dist/cjs/testeable-utils/axe-core/getMessageAndPass.js.map +2 -2
- package/dist/cjs/testeable-utils/axe-core/index.js +5 -1
- package/dist/cjs/testeable-utils/axe-core/index.js.map +2 -2
- package/dist/cjs/testeable-utils/axe-core/reporter.js +4 -0
- package/dist/cjs/testeable-utils/axe-core/reporter.js.map +1 -1
- package/dist/cjs/testeable-utils/axe-core/shouldIgnoreNodeViolation.js +4 -0
- package/dist/cjs/testeable-utils/axe-core/shouldIgnoreNodeViolation.js.map +1 -1
- package/dist/cjs/testeable-utils/axe-core/toHaveNoViolations.js +6 -2
- package/dist/cjs/testeable-utils/axe-core/toHaveNoViolations.js.map +2 -2
- package/dist/cjs/testeable-utils/index.js +6 -2
- package/dist/cjs/testeable-utils/index.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/testeable-utils/DSVirtualList.js.map +1 -1
- package/dist/esm/testeable-utils/axe-core/getMessageAndPass.js +1 -1
- package/dist/esm/testeable-utils/axe-core/getMessageAndPass.js.map +1 -1
- package/dist/esm/testeable-utils/axe-core/index.js +1 -1
- package/dist/esm/testeable-utils/axe-core/index.js.map +1 -1
- package/dist/esm/testeable-utils/axe-core/toHaveNoViolations.js +2 -2
- package/dist/esm/testeable-utils/axe-core/toHaveNoViolations.js.map +1 -1
- package/dist/esm/testeable-utils/index.js +2 -2
- package/dist/esm/testeable-utils/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/testeable-utils/axe-core/index.d.ts +1 -1
- package/dist/types/testeable-utils/index.d.ts +2 -2
- package/package.json +11 -6
package/dist/cjs/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -30,5 +34,5 @@ __export(src_exports, {
|
|
|
30
34
|
});
|
|
31
35
|
module.exports = __toCommonJS(src_exports);
|
|
32
36
|
var React = __toESM(require("react"));
|
|
33
|
-
var import_testeable_utils = require("./testeable-utils");
|
|
37
|
+
var import_testeable_utils = require("./testeable-utils/index.js");
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './testeable-utils';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './testeable-utils/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,6BAA2F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/testeable-utils/DSVirtualList.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable import/namespace */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport * as virtualLib from '@tanstack/react-virtual';\n// this mutableScope thing may be over-kill\n// better safe than sorry?\nconst mutableScope = { original: virtualLib.useVirtualizer };\n\ntype MakeTesteableParams = {\n overscan: number;\n itemHeight: number;\n parentHeight: number;\n width?: number;\n};\n\nexport const makeDSVirtualListTesteable = async ({\n overscan,\n itemHeight,\n parentHeight,\n width = 400,\n}: MakeTesteableParams): void => {\n // await import is used to avoid \"read-only\" imports at global level\n // which would prevent run-time monekey-patching\n const lib = await import('@tanstack/react-virtual');\n lib.useVirtualizer = jest.fn((virtualOpts: Parameters<virtualLib.originalUseVirtualizer>) =>\n mutableScope.original({\n ...virtualOpts,\n overscan,\n initialRect: { height: parentHeight, width },\n observeElementRect: (_, cb) => {\n cb({ height: parentHeight, width });\n },\n measureElement: () => itemHeight,\n }),\n );\n};\n\nexport const undoDSVirtualListTesteable = async () => {\n // await import is used to avoid \"read-only\" imports at global level\n // which would prevent run-time monekey-patching\n const lib = await import('@tanstack/react-virtual');\n lib.useVirtualizer = mutableScope.original;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMvB,iBAA4B;AAG5B,MAAM,eAAe,EAAE,UAAU,WAAW,eAAe;AASpD,MAAM,6BAA6B,OAAO;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,MAAiC;AAG/B,QAAM,MAAM,MAAM,OAAO,yBAAyB;AAClD,MAAI,iBAAiB,KAAK;AAAA,IAAG,CAAC,gBAC5B,aAAa,SAAS;AAAA,MACpB,GAAG;AAAA,MACH;AAAA,MACA,aAAa,EAAE,QAAQ,cAAc,MAAM;AAAA,MAC3C,oBAAoB,CAAC,GAAG,OAAO;AAC7B,WAAG,EAAE,QAAQ,cAAc,MAAM,CAAC;AAAA,MACpC;AAAA,MACA,gBAAgB,MAAM;AAAA,IACxB,CAAC;AAAA,EACH;AACF;AAEO,MAAM,6BAA6B,YAAY;AAGpD,QAAM,MAAM,MAAM,OAAO,yBAAyB;AAClD,MAAI,iBAAiB,aAAa;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -29,7 +33,7 @@ __export(getMessageAndPass_exports, {
|
|
|
29
33
|
module.exports = __toCommonJS(getMessageAndPass_exports);
|
|
30
34
|
var React = __toESM(require("react"));
|
|
31
35
|
var import_jest_matcher_utils = require("jest-matcher-utils");
|
|
32
|
-
var import_reporter = require("./reporter");
|
|
36
|
+
var import_reporter = require("./reporter.js");
|
|
33
37
|
const getMessageAndPass = (violations) => {
|
|
34
38
|
const formatedViolations = (0, import_reporter.reporter)(violations);
|
|
35
39
|
const pass = formatedViolations.length === 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testeable-utils/axe-core/getMessageAndPass.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { Result } from 'axe-core';\nimport { matcherHint } from 'jest-matcher-utils';\nimport { reporter } from './reporter';\n\nexport const getMessageAndPass = (violations: Result[]) => {\n const formatedViolations = reporter(violations);\n const pass = formatedViolations.length === 0;\n if (pass) return { message: () => '', pass };\n return { message: () => `${matcherHint('.toHaveNoViolations')}\\n\\n${formatedViolations}`, pass };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Result } from 'axe-core';\nimport { matcherHint } from 'jest-matcher-utils';\nimport { reporter } from './reporter.js';\n\nexport const getMessageAndPass = (violations: Result[]) => {\n const formatedViolations = reporter(violations);\n const pass = formatedViolations.length === 0;\n if (pass) return { message: () => '', pass };\n return { message: () => `${matcherHint('.toHaveNoViolations')}\\n\\n${formatedViolations}`, pass };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,gCAA4B;AAC5B,sBAAyB;AAElB,MAAM,oBAAoB,CAAC,eAAyB;AACzD,QAAM,yBAAqB,0BAAS,UAAU;AAC9C,QAAM,OAAO,mBAAmB,WAAW;AAC3C,MAAI;AAAM,WAAO,EAAE,SAAS,MAAM,IAAI,KAAK;AAC3C,SAAO,EAAE,SAAS,MAAM,OAAG,uCAAY,qBAAqB;AAAA;AAAA,EAAQ,sBAAsB,KAAK;AACjG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -28,5 +32,5 @@ __export(axe_core_exports, {
|
|
|
28
32
|
});
|
|
29
33
|
module.exports = __toCommonJS(axe_core_exports);
|
|
30
34
|
var React = __toESM(require("react"));
|
|
31
|
-
var import_toHaveNoViolations = require("./toHaveNoViolations");
|
|
35
|
+
var import_toHaveNoViolations = require("./toHaveNoViolations.js");
|
|
32
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testeable-utils/axe-core/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { toHaveNoViolations } from './toHaveNoViolations';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { toHaveNoViolations } from './toHaveNoViolations.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,gCAAmC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testeable-utils/axe-core/reporter.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type { Result } from 'axe-core';\nimport { printReceived } from 'jest-matcher-utils';\n\nconst colorYellow = (arg?: string) => `\\x1b[93m ${arg || ''} \\x1b[0m`;\nconst colorGrey = (arg?: string) => `\\x1b[90m ${arg || ''} \\x1b[0m`;\nconst colorBlue = (arg?: string) => `\\x1b[34m ${arg || ''} \\x1b[0m`;\n\n// relevant code from https://github.com/nickcolley/jest-axe/blob/main/index.js\nexport const reporter = (violToFormat: Result[]) => {\n if (violToFormat.length === 0) return '';\n const lineBreak = '\\n\\n';\n const horizontalLine = '\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500';\n return violToFormat\n .map((violation) => {\n const errorBody = violation.nodes\n .map((node) => {\n const selector = node.target.join(', ');\n const expectedText = `Expected the HTML found at $('${selector}') to have no violations:${lineBreak}`;\n return `${expectedText + colorGrey(node.html) + lineBreak}Received:${lineBreak}${printReceived(\n `${violation.help} (${violation.id})`,\n )}${lineBreak}${colorYellow(node.failureSummary)}${lineBreak}${\n violation.helpUrl\n ? `You can find more information on this issue here: \\n${colorBlue(violation.helpUrl)}`\n : ''\n }`;\n })\n .join(lineBreak);\n\n return errorBody;\n })\n .join(lineBreak + horizontalLine + lineBreak);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,gCAA8B;AAE9B,MAAM,cAAc,CAAC,QAAiB,YAAY,OAAO;AACzD,MAAM,YAAY,CAAC,QAAiB,YAAY,OAAO;AACvD,MAAM,YAAY,CAAC,QAAiB,YAAY,OAAO;AAGhD,MAAM,WAAW,CAAC,iBAA2B;AAClD,MAAI,aAAa,WAAW;AAAG,WAAO;AACtC,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACvB,SAAO,aACJ,IAAI,CAAC,cAAc;AAClB,UAAM,YAAY,UAAU,MACzB,IAAI,CAAC,SAAS;AACb,YAAM,WAAW,KAAK,OAAO,KAAK,IAAI;AACtC,YAAM,eAAe,iCAAiC,oCAAoC;AAC1F,aAAO,GAAG,eAAe,UAAU,KAAK,IAAI,IAAI,qBAAqB,gBAAY;AAAA,QAC/E,GAAG,UAAU,SAAS,UAAU;AAAA,MAClC,IAAI,YAAY,YAAY,KAAK,cAAc,IAAI,YACjD,UAAU,UACN;AAAA,EAAuD,UAAU,UAAU,OAAO,MAClF;AAAA,IAER,CAAC,EACA,KAAK,SAAS;AAEjB,WAAO;AAAA,EACT,CAAC,EACA,KAAK,YAAY,iBAAiB,SAAS;AAChD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testeable-utils/axe-core/shouldIgnoreNodeViolation.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type { NodeResult, Result } from 'axe-core';\nconst dataAttributeRegexp = /(data-[\\S]*)=[\"']([\\S]*)[\"']/gm;\n\nexport const shouldIgnoreNodeViolation = (node: NodeResult, violation: Result): boolean =>\n [...node.html.matchAll(dataAttributeRegexp)]\n .map(([fullMatch, dataKey, dataValue]) => ({\n fullMatch,\n dataKey,\n dataValue,\n }))\n .some(({ dataKey, dataValue }) => dataKey === `data-axe-ignore-${violation.id}` && dataValue === 'true');\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,MAAM,sBAAsB;AAErB,MAAM,4BAA4B,CAAC,MAAkB,cAC1D,CAAC,GAAG,KAAK,KAAK,SAAS,mBAAmB,CAAC,EACxC,IAAI,CAAC,CAAC,WAAW,SAAS,SAAS,OAAO;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AACF,EAAE,EACD,KAAK,CAAC,EAAE,SAAS,UAAU,MAAM,YAAY,mBAAmB,UAAU,QAAQ,cAAc,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -28,8 +32,8 @@ __export(toHaveNoViolations_exports, {
|
|
|
28
32
|
});
|
|
29
33
|
module.exports = __toCommonJS(toHaveNoViolations_exports);
|
|
30
34
|
var React = __toESM(require("react"));
|
|
31
|
-
var import_getMessageAndPass = require("./getMessageAndPass");
|
|
32
|
-
var import_shouldIgnoreNodeViolation = require("./shouldIgnoreNodeViolation");
|
|
35
|
+
var import_getMessageAndPass = require("./getMessageAndPass.js");
|
|
36
|
+
var import_shouldIgnoreNodeViolation = require("./shouldIgnoreNodeViolation.js");
|
|
33
37
|
const toHaveNoViolations = {
|
|
34
38
|
toHaveNoViolations(results) {
|
|
35
39
|
const { violations } = results;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testeable-utils/axe-core/toHaveNoViolations.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { AxeResults, NodeResult, Result } from 'axe-core';\nimport { getMessageAndPass } from './getMessageAndPass';\nimport { shouldIgnoreNodeViolation } from './shouldIgnoreNodeViolation';\n\nexport const toHaveNoViolations = {\n toHaveNoViolations(results: AxeResults) {\n const { violations } = results;\n const finalViolations: Result[] = [];\n violations.forEach((violation) => {\n const { nodes } = violation;\n const newNodes: NodeResult[] = [];\n nodes.forEach((node) => {\n if (!shouldIgnoreNodeViolation(node, violation)) newNodes.push(node);\n });\n if (newNodes.length > 0) {\n finalViolations.push({ ...violation, nodes: newNodes });\n }\n });\n\n return { actual: violations, ...getMessageAndPass(finalViolations) };\n },\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { AxeResults, NodeResult, Result } from 'axe-core';\nimport { getMessageAndPass } from './getMessageAndPass.js';\nimport { shouldIgnoreNodeViolation } from './shouldIgnoreNodeViolation.js';\n\nexport const toHaveNoViolations = {\n toHaveNoViolations(results: AxeResults) {\n const { violations } = results;\n const finalViolations: Result[] = [];\n violations.forEach((violation) => {\n const { nodes } = violation;\n const newNodes: NodeResult[] = [];\n nodes.forEach((node) => {\n if (!shouldIgnoreNodeViolation(node, violation)) newNodes.push(node);\n });\n if (newNodes.length > 0) {\n finalViolations.push({ ...violation, nodes: newNodes });\n }\n });\n\n return { actual: violations, ...getMessageAndPass(finalViolations) };\n },\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAkC;AAClC,uCAA0C;AAEnC,MAAM,qBAAqB;AAAA,EAChC,mBAAmB,SAAqB;AACtC,UAAM,EAAE,WAAW,IAAI;AACvB,UAAM,kBAA4B,CAAC;AACnC,eAAW,QAAQ,CAAC,cAAc;AAChC,YAAM,EAAE,MAAM,IAAI;AAClB,YAAM,WAAyB,CAAC;AAChC,YAAM,QAAQ,CAAC,SAAS;AACtB,YAAI,KAAC,4DAA0B,MAAM,SAAS;AAAG,mBAAS,KAAK,IAAI;AAAA,MACrE,CAAC;AACD,UAAI,SAAS,SAAS,GAAG;AACvB,wBAAgB,KAAK,EAAE,GAAG,WAAW,OAAO,SAAS,CAAC;AAAA,MACxD;AAAA,IACF,CAAC;AAED,WAAO,EAAE,QAAQ,YAAY,OAAG,4CAAkB,eAAe,EAAE;AAAA,EACrE;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -30,6 +34,6 @@ __export(testeable_utils_exports, {
|
|
|
30
34
|
});
|
|
31
35
|
module.exports = __toCommonJS(testeable_utils_exports);
|
|
32
36
|
var React = __toESM(require("react"));
|
|
33
|
-
var import_axe_core = require("./axe-core");
|
|
34
|
-
var import_DSVirtualList = require("./DSVirtualList");
|
|
37
|
+
var import_axe_core = require("./axe-core/index.js");
|
|
38
|
+
var import_DSVirtualList = require("./DSVirtualList.js");
|
|
35
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/testeable-utils/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { toHaveNoViolations } from './axe-core';\nexport { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './DSVirtualList';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { toHaveNoViolations } from './axe-core/index.js';\nexport { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './DSVirtualList.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAAmC;AACnC,2BAAuE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from "./testeable-utils";
|
|
2
|
+
import { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from "./testeable-utils/index.js";
|
|
3
3
|
export {
|
|
4
4
|
makeDSVirtualListTesteable,
|
|
5
5
|
toHaveNoViolations,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './testeable-utils';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './testeable-utils/index.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oBAAoB,4BAA4B,kCAAkC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/testeable-utils/DSVirtualList.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable import/namespace */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport * as virtualLib from '@tanstack/react-virtual';\n// this mutableScope thing may be over-kill\n// better safe than sorry?\nconst mutableScope = { original: virtualLib.useVirtualizer };\n\ntype MakeTesteableParams = {\n overscan: number;\n itemHeight: number;\n parentHeight: number;\n width?: number;\n};\n\nexport const makeDSVirtualListTesteable = async ({\n overscan,\n itemHeight,\n parentHeight,\n width = 400,\n}: MakeTesteableParams): void => {\n // await import is used to avoid \"read-only\" imports at global level\n // which would prevent run-time monekey-patching\n const lib = await import('@tanstack/react-virtual');\n lib.useVirtualizer = jest.fn((virtualOpts: Parameters<virtualLib.originalUseVirtualizer>) =>\n mutableScope.original({\n ...virtualOpts,\n overscan,\n initialRect: { height: parentHeight, width },\n observeElementRect: (_, cb) => {\n cb({ height: parentHeight, width });\n },\n measureElement: () => itemHeight,\n }),\n );\n};\n\nexport const undoDSVirtualListTesteable = async () => {\n // await import is used to avoid \"read-only\" imports at global level\n // which would prevent run-time monekey-patching\n const lib = await import('@tanstack/react-virtual');\n lib.useVirtualizer = mutableScope.original;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACMvB,YAAY,gBAAgB;AAG5B,MAAM,eAAe,EAAE,UAAU,WAAW,eAAe;AASpD,MAAM,6BAA6B,OAAO;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,MAAiC;AAG/B,QAAM,MAAM,MAAM,OAAO;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACMvB,YAAY,gBAAgB;AAG5B,MAAM,eAAe,EAAE,UAAU,WAAW,eAAe;AASpD,MAAM,6BAA6B,OAAO;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,MAAiC;AAG/B,QAAM,MAAM,MAAM,OAAO,yBAAyB;AAClD,MAAI,iBAAiB,KAAK;AAAA,IAAG,CAAC,gBAC5B,aAAa,SAAS;AAAA,MACpB,GAAG;AAAA,MACH;AAAA,MACA,aAAa,EAAE,QAAQ,cAAc,MAAM;AAAA,MAC3C,oBAAoB,CAAC,GAAG,OAAO;AAC7B,WAAG,EAAE,QAAQ,cAAc,MAAM,CAAC;AAAA,MACpC;AAAA,MACA,gBAAgB,MAAM;AAAA,IACxB,CAAC;AAAA,EACH;AACF;AAEO,MAAM,6BAA6B,YAAY;AAGpD,QAAM,MAAM,MAAM,OAAO,yBAAyB;AAClD,MAAI,iBAAiB,aAAa;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { matcherHint } from "jest-matcher-utils";
|
|
3
|
-
import { reporter } from "./reporter";
|
|
3
|
+
import { reporter } from "./reporter.js";
|
|
4
4
|
const getMessageAndPass = (violations) => {
|
|
5
5
|
const formatedViolations = reporter(violations);
|
|
6
6
|
const pass = formatedViolations.length === 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/testeable-utils/axe-core/getMessageAndPass.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Result } from 'axe-core';\nimport { matcherHint } from 'jest-matcher-utils';\nimport { reporter } from './reporter';\n\nexport const getMessageAndPass = (violations: Result[]) => {\n const formatedViolations = reporter(violations);\n const pass = formatedViolations.length === 0;\n if (pass) return { message: () => '', pass };\n return { message: () => `${matcherHint('.toHaveNoViolations')}\\n\\n${formatedViolations}`, pass };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Result } from 'axe-core';\nimport { matcherHint } from 'jest-matcher-utils';\nimport { reporter } from './reporter.js';\n\nexport const getMessageAndPass = (violations: Result[]) => {\n const formatedViolations = reporter(violations);\n const pass = formatedViolations.length === 0;\n if (pass) return { message: () => '', pass };\n return { message: () => `${matcherHint('.toHaveNoViolations')}\\n\\n${formatedViolations}`, pass };\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAElB,MAAM,oBAAoB,CAAC,eAAyB;AACzD,QAAM,qBAAqB,SAAS,UAAU;AAC9C,QAAM,OAAO,mBAAmB,WAAW;AAC3C,MAAI;AAAM,WAAO,EAAE,SAAS,MAAM,IAAI,KAAK;AAC3C,SAAO,EAAE,SAAS,MAAM,GAAG,YAAY,qBAAqB;AAAA;AAAA,EAAQ,sBAAsB,KAAK;AACjG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/testeable-utils/axe-core/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { toHaveNoViolations } from './toHaveNoViolations';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { toHaveNoViolations } from './toHaveNoViolations.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,0BAA0B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { getMessageAndPass } from "./getMessageAndPass";
|
|
3
|
-
import { shouldIgnoreNodeViolation } from "./shouldIgnoreNodeViolation";
|
|
2
|
+
import { getMessageAndPass } from "./getMessageAndPass.js";
|
|
3
|
+
import { shouldIgnoreNodeViolation } from "./shouldIgnoreNodeViolation.js";
|
|
4
4
|
const toHaveNoViolations = {
|
|
5
5
|
toHaveNoViolations(results) {
|
|
6
6
|
const { violations } = results;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/testeable-utils/axe-core/toHaveNoViolations.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { AxeResults, NodeResult, Result } from 'axe-core';\nimport { getMessageAndPass } from './getMessageAndPass';\nimport { shouldIgnoreNodeViolation } from './shouldIgnoreNodeViolation';\n\nexport const toHaveNoViolations = {\n toHaveNoViolations(results: AxeResults) {\n const { violations } = results;\n const finalViolations: Result[] = [];\n violations.forEach((violation) => {\n const { nodes } = violation;\n const newNodes: NodeResult[] = [];\n nodes.forEach((node) => {\n if (!shouldIgnoreNodeViolation(node, violation)) newNodes.push(node);\n });\n if (newNodes.length > 0) {\n finalViolations.push({ ...violation, nodes: newNodes });\n }\n });\n\n return { actual: violations, ...getMessageAndPass(finalViolations) };\n },\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { AxeResults, NodeResult, Result } from 'axe-core';\nimport { getMessageAndPass } from './getMessageAndPass.js';\nimport { shouldIgnoreNodeViolation } from './shouldIgnoreNodeViolation.js';\n\nexport const toHaveNoViolations = {\n toHaveNoViolations(results: AxeResults) {\n const { violations } = results;\n const finalViolations: Result[] = [];\n violations.forEach((violation) => {\n const { nodes } = violation;\n const newNodes: NodeResult[] = [];\n nodes.forEach((node) => {\n if (!shouldIgnoreNodeViolation(node, violation)) newNodes.push(node);\n });\n if (newNodes.length > 0) {\n finalViolations.push({ ...violation, nodes: newNodes });\n }\n });\n\n return { actual: violations, ...getMessageAndPass(finalViolations) };\n },\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,yBAAyB;AAClC,SAAS,iCAAiC;AAEnC,MAAM,qBAAqB;AAAA,EAChC,mBAAmB,SAAqB;AACtC,UAAM,EAAE,WAAW,IAAI;AACvB,UAAM,kBAA4B,CAAC;AACnC,eAAW,QAAQ,CAAC,cAAc;AAChC,YAAM,EAAE,MAAM,IAAI;AAClB,YAAM,WAAyB,CAAC;AAChC,YAAM,QAAQ,CAAC,SAAS;AACtB,YAAI,CAAC,0BAA0B,MAAM,SAAS;AAAG,mBAAS,KAAK,IAAI;AAAA,MACrE,CAAC;AACD,UAAI,SAAS,SAAS,GAAG;AACvB,wBAAgB,KAAK,EAAE,GAAG,WAAW,OAAO,SAAS,CAAC;AAAA,MACxD;AAAA,IACF,CAAC;AAED,WAAO,EAAE,QAAQ,YAAY,GAAG,kBAAkB,eAAe,EAAE;AAAA,EACrE;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { toHaveNoViolations } from "./axe-core";
|
|
3
|
-
import { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from "./DSVirtualList";
|
|
2
|
+
import { toHaveNoViolations } from "./axe-core/index.js";
|
|
3
|
+
import { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from "./DSVirtualList.js";
|
|
4
4
|
export {
|
|
5
5
|
makeDSVirtualListTesteable,
|
|
6
6
|
toHaveNoViolations,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/testeable-utils/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { toHaveNoViolations } from './axe-core';\nexport { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './DSVirtualList';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { toHaveNoViolations } from './axe-core/index.js';\nexport { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './DSVirtualList.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,0BAA0B;AACnC,SAAS,4BAA4B,kCAAkC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './testeable-utils';
|
|
1
|
+
export { toHaveNoViolations, makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './testeable-utils/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { toHaveNoViolations } from './toHaveNoViolations';
|
|
1
|
+
export { toHaveNoViolations } from './toHaveNoViolations.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { toHaveNoViolations } from './axe-core';
|
|
2
|
-
export { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './DSVirtualList';
|
|
1
|
+
export { toHaveNoViolations } from './axe-core/index.js';
|
|
2
|
+
export { makeDSVirtualListTesteable, undoDSVirtualListTesteable } from './DSVirtualList.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-test-utils",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.1-rc.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Test utilities",
|
|
6
6
|
"files": [
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./dist/esm/index.js",
|
|
15
15
|
"require": "./dist/cjs/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./a11y": {
|
|
18
|
+
"import": "./dist/esm/testeable-utils/axe-core/index.js",
|
|
19
|
+
"require": "./dist/cjs/testeable-utils/axe-core/index.js"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"sideEffects": [
|
|
@@ -35,16 +39,17 @@
|
|
|
35
39
|
"indent": 4
|
|
36
40
|
},
|
|
37
41
|
"dependencies": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"jest-
|
|
41
|
-
"
|
|
42
|
+
"@tanstack/react-virtual": "3.0.0-beta.54",
|
|
43
|
+
"axe-core": "4.6.3",
|
|
44
|
+
"jest-axe": "7.0.1",
|
|
45
|
+
"jest-matcher-utils": "29.5.0",
|
|
46
|
+
"@elliemae/ds-system": "3.16.1-rc.10"
|
|
42
47
|
},
|
|
43
48
|
"devDependencies": {
|
|
44
49
|
"@testing-library/dom": "~8.19.0",
|
|
45
50
|
"@testing-library/jest-dom": "~5.16.5",
|
|
46
51
|
"@testing-library/react": "~12.1.3",
|
|
47
|
-
"styled-components": "~5.3.
|
|
52
|
+
"styled-components": "~5.3.9"
|
|
48
53
|
},
|
|
49
54
|
"peerDependencies": {
|
|
50
55
|
"react": "^17.0.2",
|