box-ui-elements 23.4.0-beta.16 → 23.4.0-beta.17
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/explorer.js +1 -1
- package/dist/preview.js +1 -1
- package/dist/sidebar.js +1 -1
- package/es/elements/common/nav-button/BackButton.js +5 -8
- package/es/elements/common/nav-button/BackButton.js.flow +8 -18
- package/es/elements/common/nav-button/BackButton.js.map +1 -1
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js +6 -3
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.flow +47 -42
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsSidebar.js +6 -3
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.flow +48 -39
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.map +1 -1
- package/es/src/test-utils/testing-library.d.ts +2 -1
- package/es/test-utils/testing-library.js +4 -1
- package/es/test-utils/testing-library.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/common/nav-button/BackButton.js +8 -18
- package/src/elements/common/nav-button/__tests__/BackButton.test.js +36 -27
- package/src/elements/content-sidebar/versions/StaticVersionSidebar.js +47 -42
- package/src/elements/content-sidebar/versions/VersionsSidebar.js +48 -39
- package/src/elements/content-sidebar/versions/__tests__/StaticVersionSidebar.test.js +171 -0
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebar.test.js +147 -20
- package/src/test-utils/testing-library.tsx +4 -1
- package/src/elements/common/nav-button/__tests__/__snapshots__/BackButton.test.js.snap +0 -64
- package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebar.test.js.snap +0 -92
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, type RenderOptions } from '@testing-library/react';
|
|
3
|
+
import userEventInit from '@testing-library/user-event';
|
|
3
4
|
|
|
4
5
|
// Data Providers
|
|
5
6
|
import { TooltipProvider } from '@box/blueprint-web';
|
|
@@ -26,5 +27,7 @@ const renderConnected = (element, options: RenderConnectedOptions = {}) =>
|
|
|
26
27
|
...options,
|
|
27
28
|
});
|
|
28
29
|
|
|
30
|
+
const createUserEvent = () => userEventInit.setup(); // factory function to create isolated userEvent instances
|
|
31
|
+
|
|
29
32
|
export * from '@testing-library/react';
|
|
30
|
-
export { renderConnected as render };
|
|
33
|
+
export { renderConnected as render, createUserEvent as userEvent };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`elements/common/nav-button/BackButton should match its snapshot 1`] = `
|
|
4
|
-
<BackButton>
|
|
5
|
-
<Route>
|
|
6
|
-
<PlainButton
|
|
7
|
-
className="bdl-BackButton"
|
|
8
|
-
onClick={[Function]}
|
|
9
|
-
type="button"
|
|
10
|
-
>
|
|
11
|
-
<button
|
|
12
|
-
className="btn-plain bdl-BackButton"
|
|
13
|
-
onClick={[Function]}
|
|
14
|
-
type="button"
|
|
15
|
-
>
|
|
16
|
-
<IconNavigateLeft
|
|
17
|
-
height={24}
|
|
18
|
-
width={24}
|
|
19
|
-
>
|
|
20
|
-
<AccessibleSVG
|
|
21
|
-
className="icon-navigate-left "
|
|
22
|
-
focusable="false"
|
|
23
|
-
height={24}
|
|
24
|
-
viewBox="0 0 48 48"
|
|
25
|
-
width={24}
|
|
26
|
-
>
|
|
27
|
-
<svg
|
|
28
|
-
aria-hidden="true"
|
|
29
|
-
className="icon-navigate-left "
|
|
30
|
-
focusable="false"
|
|
31
|
-
height={24}
|
|
32
|
-
role="presentation"
|
|
33
|
-
viewBox="0 0 48 48"
|
|
34
|
-
width={24}
|
|
35
|
-
>
|
|
36
|
-
<path
|
|
37
|
-
d="M30.8,33.2L21.7,24l9.2-9.2L28,12L16,24l12,12L30.8,33.2z"
|
|
38
|
-
fill="#494949"
|
|
39
|
-
stroke="#DCDCDC"
|
|
40
|
-
strokeMiterlimit="10"
|
|
41
|
-
/>
|
|
42
|
-
<path
|
|
43
|
-
d="M0,0h48v48H0V0z"
|
|
44
|
-
display="none"
|
|
45
|
-
fill="none"
|
|
46
|
-
/>
|
|
47
|
-
</svg>
|
|
48
|
-
</AccessibleSVG>
|
|
49
|
-
</IconNavigateLeft>
|
|
50
|
-
<span
|
|
51
|
-
className="accessibility-hidden"
|
|
52
|
-
>
|
|
53
|
-
<FormattedMessage
|
|
54
|
-
defaultMessage="Back"
|
|
55
|
-
id="be.back"
|
|
56
|
-
>
|
|
57
|
-
<div />
|
|
58
|
-
</FormattedMessage>
|
|
59
|
-
</span>
|
|
60
|
-
</button>
|
|
61
|
-
</PlainButton>
|
|
62
|
-
</Route>
|
|
63
|
-
</BackButton>
|
|
64
|
-
`;
|
package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebar.test.js.snap
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`elements/content-sidebar/versions/VersionsSidebar render should show an inline error if the prop is provided 1`] = `
|
|
4
|
-
<SidebarContent
|
|
5
|
-
className="bcs-Versions"
|
|
6
|
-
data-resin-component="preview"
|
|
7
|
-
data-resin-feature="versions"
|
|
8
|
-
elementId=""
|
|
9
|
-
sidebarView=""
|
|
10
|
-
title={
|
|
11
|
-
<React.Fragment>
|
|
12
|
-
<BackButton
|
|
13
|
-
data-resin-target="back"
|
|
14
|
-
to="/activity"
|
|
15
|
-
/>
|
|
16
|
-
<FormattedMessage
|
|
17
|
-
defaultMessage="Version History"
|
|
18
|
-
id="be.sidebarVersions.title"
|
|
19
|
-
/>
|
|
20
|
-
</React.Fragment>
|
|
21
|
-
}
|
|
22
|
-
>
|
|
23
|
-
<LoadingIndicatorWrapper
|
|
24
|
-
className="bcs-Versions-content"
|
|
25
|
-
crawlerPosition="top"
|
|
26
|
-
>
|
|
27
|
-
<InlineError
|
|
28
|
-
title={
|
|
29
|
-
<FormattedMessage
|
|
30
|
-
defaultMessage="Server Error"
|
|
31
|
-
id="be.sidebarVersions.serverError"
|
|
32
|
-
/>
|
|
33
|
-
}
|
|
34
|
-
>
|
|
35
|
-
<FormattedMessage
|
|
36
|
-
defaultMessage="File versions could not be retrieved."
|
|
37
|
-
id="be.sidebarVersions.fetchError"
|
|
38
|
-
/>
|
|
39
|
-
</InlineError>
|
|
40
|
-
<div
|
|
41
|
-
className="bcs-Versions-empty"
|
|
42
|
-
>
|
|
43
|
-
<FormattedMessage
|
|
44
|
-
defaultMessage="No prior versions are available for this file."
|
|
45
|
-
id="be.sidebarVersions.empty"
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
</LoadingIndicatorWrapper>
|
|
49
|
-
</SidebarContent>
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
exports[`elements/content-sidebar/versions/VersionsSidebar render should show the versions list if no error prop is provided 1`] = `
|
|
53
|
-
<SidebarContent
|
|
54
|
-
className="bcs-Versions"
|
|
55
|
-
data-resin-component="preview"
|
|
56
|
-
data-resin-feature="versions"
|
|
57
|
-
elementId=""
|
|
58
|
-
sidebarView=""
|
|
59
|
-
title={
|
|
60
|
-
<React.Fragment>
|
|
61
|
-
<BackButton
|
|
62
|
-
data-resin-target="back"
|
|
63
|
-
to="/activity"
|
|
64
|
-
/>
|
|
65
|
-
<FormattedMessage
|
|
66
|
-
defaultMessage="Version History"
|
|
67
|
-
id="be.sidebarVersions.title"
|
|
68
|
-
/>
|
|
69
|
-
</React.Fragment>
|
|
70
|
-
}
|
|
71
|
-
>
|
|
72
|
-
<LoadingIndicatorWrapper
|
|
73
|
-
className="bcs-Versions-content"
|
|
74
|
-
crawlerPosition="top"
|
|
75
|
-
>
|
|
76
|
-
<div
|
|
77
|
-
className="bcs-Versions-menu"
|
|
78
|
-
data-testid="bcs-Versions-menu"
|
|
79
|
-
>
|
|
80
|
-
<Component
|
|
81
|
-
versions={
|
|
82
|
-
[
|
|
83
|
-
{
|
|
84
|
-
"id": "12345",
|
|
85
|
-
},
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
/>
|
|
89
|
-
</div>
|
|
90
|
-
</LoadingIndicatorWrapper>
|
|
91
|
-
</SidebarContent>
|
|
92
|
-
`;
|