@salutejs/plasma-cy-utils 0.178.0-next-sbcom.0 → 0.178.0
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/lib/getTests.d.ts +6 -1
- package/lib/getTests.js +3 -2
- package/package.json +9 -9
package/lib/getTests.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ type GetBaseVisualTestsArgs = {
|
|
|
36
36
|
* Список пакетов, для которых тесты будут пропущены через describe.skip.
|
|
37
37
|
*/
|
|
38
38
|
packagesForSkip?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Имя компонента, чей конфиг использовать для построения матрицы (если отличается от component).
|
|
41
|
+
*/
|
|
42
|
+
configComponentName?: string;
|
|
39
43
|
};
|
|
40
44
|
/**
|
|
41
45
|
* Генерирует базовые визуальные тесты для компонента.
|
|
@@ -55,6 +59,7 @@ type GetBaseVisualTestsArgs = {
|
|
|
55
59
|
* @param {Record<string, string[]>} excludePropsValues - значения пропов, исключаемые из матрицы.
|
|
56
60
|
* @param {string[]} propsForName - пропсы, значения которых включаются в имя теста.
|
|
57
61
|
* @param {string[]} packagesForSkip - список пакетов, для которых тесты будут пропущены через describe.skip.
|
|
62
|
+
* @param {string} configComponentName - имя компонента, чей конфиг использовать для построения матрицы.
|
|
58
63
|
*/
|
|
59
|
-
export declare const getBaseVisualTests: ({ component, componentProps, children, actionBeforeSnapshot, configPropsForMatrix, excludePropsValues, propsForName, packagesForSkip, }: GetBaseVisualTestsArgs) => void | Mocha.Suite;
|
|
64
|
+
export declare const getBaseVisualTests: ({ component, componentProps, children, actionBeforeSnapshot, configPropsForMatrix, excludePropsValues, propsForName, packagesForSkip, configComponentName, }: GetBaseVisualTestsArgs) => void | Mocha.Suite;
|
|
60
65
|
export {};
|
package/lib/getTests.js
CHANGED
|
@@ -46,9 +46,10 @@ var getConfig = function (component) {
|
|
|
46
46
|
* @param {Record<string, string[]>} excludePropsValues - значения пропов, исключаемые из матрицы.
|
|
47
47
|
* @param {string[]} propsForName - пропсы, значения которых включаются в имя теста.
|
|
48
48
|
* @param {string[]} packagesForSkip - список пакетов, для которых тесты будут пропущены через describe.skip.
|
|
49
|
+
* @param {string} configComponentName - имя компонента, чей конфиг использовать для построения матрицы.
|
|
49
50
|
*/
|
|
50
51
|
var getBaseVisualTests = function (_a) {
|
|
51
|
-
var component = _a.component, componentProps = _a.componentProps, children = _a.children, actionBeforeSnapshot = _a.actionBeforeSnapshot, configPropsForMatrix = _a.configPropsForMatrix, excludePropsValues = _a.excludePropsValues, propsForName = _a.propsForName, packagesForSkip = _a.packagesForSkip;
|
|
52
|
+
var component = _a.component, componentProps = _a.componentProps, children = _a.children, actionBeforeSnapshot = _a.actionBeforeSnapshot, configPropsForMatrix = _a.configPropsForMatrix, excludePropsValues = _a.excludePropsValues, propsForName = _a.propsForName, packagesForSkip = _a.packagesForSkip, configComponentName = _a.configComponentName;
|
|
52
53
|
var componentExists = (0, CypressDecorator_1.hasComponent)(component);
|
|
53
54
|
var pkgName = Cypress.env('package');
|
|
54
55
|
var describeFn = (packagesForSkip === null || packagesForSkip === void 0 ? void 0 : packagesForSkip.includes(pkgName)) ? describe.skip : (0, CypressDecorator_1.getDescribeFN)(component);
|
|
@@ -57,7 +58,7 @@ var getBaseVisualTests = function (_a) {
|
|
|
57
58
|
if (!Component) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
|
-
var config = componentExists ? getConfig(component) : null;
|
|
61
|
+
var config = componentExists ? getConfig(configComponentName || component) : null;
|
|
61
62
|
var configMatrix = (0, getConfigMatrix_1.getConfigMatrix)(config, configPropsForMatrix, excludePropsValues);
|
|
62
63
|
configMatrix.forEach(function (combination) {
|
|
63
64
|
var testParams = Object.entries(combination)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salutejs/plasma-cy-utils",
|
|
3
|
-
"version": "0.178.0
|
|
3
|
+
"version": "0.178.0",
|
|
4
4
|
"description": "Test helpers shared between ui libraries.",
|
|
5
5
|
"author": "Salute Frontend Team <salute.developers@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@cypress/react": "5.12.0",
|
|
28
28
|
"@salutejs-ds/sdds_os": "0.1.2",
|
|
29
|
-
"@salutejs/plasma-themes": "0.69.0
|
|
30
|
-
"@salutejs/plasma-tokens": "1.159.0
|
|
31
|
-
"@salutejs/plasma-tokens-b2b": "1.71.0
|
|
32
|
-
"@salutejs/plasma-tokens-b2c": "0.82.0
|
|
33
|
-
"@salutejs/plasma-tokens-web": "1.86.0
|
|
34
|
-
"@salutejs/plasma-typo": "0.59.0
|
|
35
|
-
"@salutejs/sdds-themes": "0.86.0
|
|
29
|
+
"@salutejs/plasma-themes": "0.69.0",
|
|
30
|
+
"@salutejs/plasma-tokens": "1.159.0",
|
|
31
|
+
"@salutejs/plasma-tokens-b2b": "1.71.0",
|
|
32
|
+
"@salutejs/plasma-tokens-b2c": "0.82.0",
|
|
33
|
+
"@salutejs/plasma-tokens-web": "1.86.0",
|
|
34
|
+
"@salutejs/plasma-typo": "0.59.0",
|
|
35
|
+
"@salutejs/sdds-themes": "0.86.0",
|
|
36
36
|
"@sddsjs/sdds_finai": "0.1.1",
|
|
37
37
|
"@types/node": "18.16.20",
|
|
38
38
|
"@types/react": "18.0.28",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"files": [
|
|
51
51
|
"lib"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "17d413817cf9a7f5e3c2832d3a96c9ed9f18496c"
|
|
54
54
|
}
|