@shopgate/pwa-ui-shared 7.31.4 → 7.31.5-beta.1
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.
|
@@ -33,7 +33,8 @@ const PipelineErrorDialog = ({
|
|
|
33
33
|
params,
|
|
34
34
|
message
|
|
35
35
|
}) => {
|
|
36
|
-
|
|
36
|
+
// May be opened directly in developer detail mode (e.g. via long-pressing an error toast).
|
|
37
|
+
const [devMode, setDevMode] = useState(!!params.openWithDetails);
|
|
37
38
|
const tapTimeoutRef = useRef(null);
|
|
38
39
|
const tapCounterRef = useRef(0);
|
|
39
40
|
const handleTapTimeout = useCallback(() => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { mount } from 'enzyme';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
3
5
|
import PipelineErrorDialog from "./index";
|
|
4
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
7
|
jest.mock('@shopgate/engage/a11y/components');
|
|
@@ -51,6 +53,20 @@ describe('<PipelineErrorDialog />', () => {
|
|
|
51
53
|
clickElement.simulate('click');
|
|
52
54
|
expect(wrapper.text()).not.toContain(devMarker);
|
|
53
55
|
});
|
|
56
|
+
it('should open directly in developer detail mode when params.openWithDetails is set', () => {
|
|
57
|
+
render(/*#__PURE__*/_jsx(PipelineErrorDialog, {
|
|
58
|
+
actions: [],
|
|
59
|
+
params: {
|
|
60
|
+
...defaultParams,
|
|
61
|
+
openWithDetails: true
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
// Developer detail view is shown immediately, without any tapping.
|
|
66
|
+
expect(screen.getByText('Pipeline:')).toBeInTheDocument();
|
|
67
|
+
expect(screen.getByText('Code:')).toBeInTheDocument();
|
|
68
|
+
expect(screen.getByText(/fakePipeline/)).toBeInTheDocument();
|
|
69
|
+
});
|
|
54
70
|
it('should not switch modes if tapped too slow', () => {
|
|
55
71
|
jest.useFakeTimers();
|
|
56
72
|
const wrapper = mount(/*#__PURE__*/_jsx(PipelineErrorDialog, {
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-ui-shared",
|
|
3
|
-
"version": "7.31.
|
|
3
|
+
"version": "7.31.5-beta.1",
|
|
4
4
|
"description": "Shopgate's shared UI components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@shopgate/pwa-ui-ios": "7.31.
|
|
9
|
-
"@shopgate/pwa-ui-material": "7.31.
|
|
8
|
+
"@shopgate/pwa-ui-ios": "7.31.5-beta.1",
|
|
9
|
+
"@shopgate/pwa-ui-material": "7.31.5-beta.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@shopgate/pwa-common": "7.31.
|
|
13
|
-
"@shopgate/pwa-common-commerce": "7.31.
|
|
12
|
+
"@shopgate/pwa-common": "7.31.5-beta.1",
|
|
13
|
+
"@shopgate/pwa-common-commerce": "7.31.5-beta.1",
|
|
14
14
|
"classnames": "2.5.1",
|
|
15
15
|
"react": "^17.0.2"
|
|
16
16
|
},
|