@salutejs/plasma-cy-utils 0.163.0-next-sbcom.0 → 0.163.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/CypressDecorator.js +2 -17
- package/lib/CypressHelpers.d.ts +0 -1
- package/lib/CypressHelpers.js +1 -19
- package/package.json +9 -9
package/lib/CypressDecorator.js
CHANGED
|
@@ -9,10 +9,8 @@ var styled_components_1 = require("styled-components");
|
|
|
9
9
|
var plasma_themes_1 = require("@salutejs/plasma-themes");
|
|
10
10
|
var sdds_themes_1 = require("@salutejs/sdds-themes");
|
|
11
11
|
var sdds_os_1 = require("@salutejs-ds/sdds_os");
|
|
12
|
-
// plasma-ui
|
|
13
|
-
var themes_1 = require("@salutejs/plasma-tokens/themes");
|
|
14
12
|
// plasma-b2c
|
|
15
|
-
var
|
|
13
|
+
var themes_1 = require("@salutejs/plasma-tokens-b2c/themes");
|
|
16
14
|
var plasma_typo_1 = require("@salutejs/plasma-typo");
|
|
17
15
|
var SSRProvider_1 = require("./SSRProvider");
|
|
18
16
|
var NormalizeCSSDecorator_1 = require("./NormalizeCSSDecorator");
|
|
@@ -32,8 +30,7 @@ var ThemeHOMEDS = (0, styled_components_1.createGlobalStyle)(plasma_themes_1.pla
|
|
|
32
30
|
var ThemeWEB = (0, styled_components_1.createGlobalStyle)(plasma_themes_1.plasma_web__light);
|
|
33
31
|
var StandardTypoStyle = (0, styled_components_1.createGlobalStyle)(plasma_typo_1.standard);
|
|
34
32
|
var CompatibleTypoStyle = (0, styled_components_1.createGlobalStyle)(plasma_typo_1.compatible);
|
|
35
|
-
var ColorB2CStyle = (0, styled_components_1.createGlobalStyle)(
|
|
36
|
-
var ThemeStyle = (0, styled_components_1.createGlobalStyle)(themes_1.darkSber);
|
|
33
|
+
var ColorB2CStyle = (0, styled_components_1.createGlobalStyle)(themes_1.dark);
|
|
37
34
|
var testPackagesThemes = {
|
|
38
35
|
'plasma-giga': react_1.default.createElement(ThemeGIGA, null),
|
|
39
36
|
'sdds-cs': react_1.default.createElement(ThemeCS, null),
|
|
@@ -56,8 +53,6 @@ var getPackage = function () {
|
|
|
56
53
|
}
|
|
57
54
|
/* eslint-disable */
|
|
58
55
|
switch (pkgName) {
|
|
59
|
-
case 'plasma-ui':
|
|
60
|
-
return require('../../../packages/plasma-ui');
|
|
61
56
|
case 'plasma-web':
|
|
62
57
|
return require('../../../packages/plasma-web/dist/styled-components/cjs/index.js');
|
|
63
58
|
case 'plasma-b2c':
|
|
@@ -125,16 +120,6 @@ var CypressTestDecorator = function (_a) {
|
|
|
125
120
|
var noSSR = _a.noSSR, children = _a.children;
|
|
126
121
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
127
122
|
var pkgName = Cypress.env('package');
|
|
128
|
-
if (pkgName === 'plasma-ui') {
|
|
129
|
-
var DeviceThemeProvider = (0, exports.getComponent)('DeviceThemeProvider');
|
|
130
|
-
if (!DeviceThemeProvider) {
|
|
131
|
-
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
132
|
-
}
|
|
133
|
-
return (react_1.default.createElement(DeviceThemeProvider, null,
|
|
134
|
-
react_1.default.createElement(SSRProvider_1.SSRProvider, { noSSR: noSSR },
|
|
135
|
-
react_1.default.createElement(ThemeStyle, null),
|
|
136
|
-
children)));
|
|
137
|
-
}
|
|
138
123
|
if (pkgName === 'plasma-b2c') {
|
|
139
124
|
return (react_1.default.createElement(SSRProvider_1.SSRProvider, { noSSR: noSSR },
|
|
140
125
|
react_1.default.createElement(NormalizeCSSDecorator_1.NormalizeCSSDecorator, null),
|
package/lib/CypressHelpers.d.ts
CHANGED
package/lib/CypressHelpers.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.
|
|
6
|
+
exports.mount = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var react_2 = require("@cypress/react");
|
|
9
9
|
var CypressDecorator_1 = require("./CypressDecorator");
|
|
@@ -16,21 +16,3 @@ var mount = function () {
|
|
|
16
16
|
return (0, react_2.mount)(react_1.default.createElement(CypressDecorator_1.CypressTestDecorator, null, jsx), opts);
|
|
17
17
|
};
|
|
18
18
|
exports.mount = mount;
|
|
19
|
-
// INFO: для временного использования в plasma-ui
|
|
20
|
-
var mountLegacyMode = function () {
|
|
21
|
-
var args = [];
|
|
22
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
23
|
-
args[_i] = arguments[_i];
|
|
24
|
-
}
|
|
25
|
-
var jsx = args[0], _a = args[1], opts = _a === void 0 ? {} : _a;
|
|
26
|
-
opts.stylesheets = ((opts === null || opts === void 0 ? void 0 : opts.stylesheets) || []).concat('https://cdn-app.sberdevices.ru/shared-static/0.0.0/styles/SBSansText.0.2.0.css', 'https://cdn-app.sberdevices.ru/shared-static/0.0.0/styles/SBSansDisplay.0.2.0.css', 'https://cdn-app.sberdevices.ru/shared-static/0.0.0/styles/SBSansTextMono.0.2.0.css');
|
|
27
|
-
var cm = (0, react_2.mount)(jsx, opts);
|
|
28
|
-
cy.waitForResources('https://cdn-app.sberdevices.ru/shared-static/0.0.0/styles/SBSansText.0.2.0.css');
|
|
29
|
-
cy.waitForResources('https://cdn-app.sberdevices.ru/shared-static/0.0.0/styles/SBSansDisplay.0.2.0.css');
|
|
30
|
-
cy.waitForResources('https://cdn-app.sberdevices.ru/shared-static/0.0.0/styles/SBSansTextMono.0.2.0.css');
|
|
31
|
-
cy.waitForResources('SBSansText.0.2.0.css', 'SBSansDisplay.0.2.0.css', 'SBSansTextMono.0.2.0.css', {
|
|
32
|
-
timeout: 1500,
|
|
33
|
-
});
|
|
34
|
-
return cm;
|
|
35
|
-
};
|
|
36
|
-
exports.mountLegacyMode = mountLegacyMode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salutejs/plasma-cy-utils",
|
|
3
|
-
"version": "0.163.0
|
|
3
|
+
"version": "0.163.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.57.0
|
|
30
|
-
"@salutejs/plasma-tokens": "1.145.0
|
|
31
|
-
"@salutejs/plasma-tokens-b2b": "1.
|
|
32
|
-
"@salutejs/plasma-tokens-b2c": "0.
|
|
33
|
-
"@salutejs/plasma-tokens-web": "1.
|
|
34
|
-
"@salutejs/plasma-typo": "0.
|
|
35
|
-
"@salutejs/sdds-themes": "0.71.0
|
|
29
|
+
"@salutejs/plasma-themes": "0.57.0",
|
|
30
|
+
"@salutejs/plasma-tokens": "1.145.0",
|
|
31
|
+
"@salutejs/plasma-tokens-b2b": "1.59.0",
|
|
32
|
+
"@salutejs/plasma-tokens-b2c": "0.70.0",
|
|
33
|
+
"@salutejs/plasma-tokens-web": "1.74.0",
|
|
34
|
+
"@salutejs/plasma-typo": "0.47.0",
|
|
35
|
+
"@salutejs/sdds-themes": "0.71.0",
|
|
36
36
|
"@types/node": "18.16.20",
|
|
37
37
|
"@types/react": "18.0.28",
|
|
38
38
|
"@types/react-dom": "18.0.11",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"files": [
|
|
50
50
|
"lib"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "b6f6097bf3ea7e7021eb0d93e2d506c21b162692"
|
|
53
53
|
}
|