@datarobot/design-system 28.8.0 → 28.8.2
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/cjs/full-screen-drawer/useFullScreenDrawer.js +1 -0
- package/cjs/full-screen-drawer/useFullScreenDrawer.test.js +12 -0
- package/esm/full-screen-drawer/useFullScreenDrawer.js +1 -0
- package/esm/full-screen-drawer/useFullScreenDrawer.test.js +12 -0
- package/js/bundle/bundle.js +30536 -30535
- package/js/bundle/bundle.min.js +1 -1
- package/package.json +2 -2
|
@@ -33,6 +33,18 @@ describe('useFullScreenDrawer', function () {
|
|
|
33
33
|
expect(outerDismiss).not.toHaveBeenCalled();
|
|
34
34
|
expect(result.current.showCloseWarning).toBe(true);
|
|
35
35
|
});
|
|
36
|
+
it('should set showCloseWarning to false when onDismiss is called if shouldShowCloseWarning is passed as false', function () {
|
|
37
|
+
const outerDismiss = jest.fn();
|
|
38
|
+
const {
|
|
39
|
+
result
|
|
40
|
+
} = (0, _react.renderHook)(() => (0, _useFullScreenDrawer.useFullScreenDrawer)({
|
|
41
|
+
onDismissCallback: outerDismiss,
|
|
42
|
+
shouldShowCloseWarning: false
|
|
43
|
+
}));
|
|
44
|
+
(0, _react.act)(() => result.current.onDismiss());
|
|
45
|
+
expect(outerDismiss).toHaveBeenCalled();
|
|
46
|
+
expect(result.current.showCloseWarning).toBe(false);
|
|
47
|
+
});
|
|
36
48
|
it('should close drawer after onDismiss is called twice', function () {
|
|
37
49
|
const outerDismiss = jest.fn();
|
|
38
50
|
const {
|
|
@@ -31,6 +31,18 @@ describe('useFullScreenDrawer', function () {
|
|
|
31
31
|
expect(outerDismiss).not.toHaveBeenCalled();
|
|
32
32
|
expect(result.current.showCloseWarning).toBe(true);
|
|
33
33
|
});
|
|
34
|
+
it('should set showCloseWarning to false when onDismiss is called if shouldShowCloseWarning is passed as false', function () {
|
|
35
|
+
const outerDismiss = jest.fn();
|
|
36
|
+
const {
|
|
37
|
+
result
|
|
38
|
+
} = renderHook(() => useFullScreenDrawer({
|
|
39
|
+
onDismissCallback: outerDismiss,
|
|
40
|
+
shouldShowCloseWarning: false
|
|
41
|
+
}));
|
|
42
|
+
act(() => result.current.onDismiss());
|
|
43
|
+
expect(outerDismiss).toHaveBeenCalled();
|
|
44
|
+
expect(result.current.showCloseWarning).toBe(false);
|
|
45
|
+
});
|
|
34
46
|
it('should close drawer after onDismiss is called twice', function () {
|
|
35
47
|
const outerDismiss = jest.fn();
|
|
36
48
|
const {
|