@momo-kits/foundation 0.169.7-beta.4 → 0.169.7-beta.5
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/Application/BottomSheet.hooks.ts +8 -8
- package/Application/BottomSheet.parts.tsx +44 -34
- package/Application/BottomSheet.tsx +40 -37
- package/Application/BottomTab/ActiveIndicator.tsx +20 -15
- package/Application/BottomTab/BottomTabBar.styles.ts +18 -1
- package/Application/BottomTab/BottomTabBar.tsx +57 -72
- package/Application/BottomTab/BottomTabInset.tsx +8 -4
- package/Application/BottomTab/CurvedContainer.tsx +22 -14
- package/Application/BottomTab/CustomBottomTabItem.tsx +15 -15
- package/Application/BottomTab/DuoBarCompression.tsx +13 -19
- package/Application/BottomTab/DuoRailTabBar.tsx +20 -24
- package/Application/BottomTab/DuoTabBar.tsx +23 -13
- package/Application/BottomTab/TabBarIcon.tsx +15 -29
- package/Application/BottomTab/TabScreen.tsx +1 -5
- package/Application/BottomTab/index.tsx +33 -30
- package/Application/BottomTab/metrics.ts +46 -26
- package/Application/BottomTab/tabItems.ts +1 -1
- package/Application/BottomTab/usePressLift.ts +2 -2
- package/Application/Components/BackgroundImageView.tsx +4 -0
- package/Application/Components/DuoGlassBackground.tsx +5 -4
- package/Application/Components/HeaderAnimated.tsx +4 -0
- package/Application/Components/HeaderBackground.tsx +4 -0
- package/Application/Components/HeaderExtendHeader.tsx +11 -10
- package/Application/Components/HeaderLeft.tsx +2 -1
- package/Application/Components/HeaderRight.tsx +2 -1
- package/Application/Components/HeaderTitle.shared.ts +11 -9
- package/Application/Components/HeaderTitle.tsx +4 -3
- package/Application/Components/HeaderToolkitAction.tsx +17 -20
- package/Application/Components/NavigationButton.tsx +2 -1
- package/Application/Components/SearchHeader.tsx +17 -10
- package/Application/Components/TitleJourney.tsx +2 -2
- package/Application/Components/TitleLocation.tsx +2 -2
- package/Application/Components/TitleUser.tsx +2 -2
- package/Application/Components/useToolkitActions.tsx +17 -32
- package/Application/Localize.ts +7 -0
- package/Application/ModalScreen.tsx +10 -10
- package/Application/Navigation.ts +14 -16
- package/Application/NavigationContainer.tsx +19 -18
- package/Application/Navigator.ts +20 -48
- package/Application/ScaleSizeProvider.tsx +13 -6
- package/Application/StackScreen.tracking.ts +11 -33
- package/Application/StackScreen.tsx +10 -54
- package/Application/TooltipPortal.tsx +12 -5
- package/Application/WidgetContainer.tsx +10 -4
- package/Application/modalLayout.ts +13 -14
- package/Application/navigationOptions.tsx +21 -17
- package/Application/types.tabs.ts +0 -1
- package/Badge/Badge.tsx +5 -0
- package/Badge/BadgeDot.tsx +1 -0
- package/Badge/BadgeDotAnimation.tsx +15 -7
- package/Badge/BadgeRibbon.tsx +46 -38
- package/Badge/Shape.tsx +2 -0
- package/Badge/types.ts +2 -2
- package/Button/index.tsx +5 -16
- package/Button/utils.ts +9 -15
- package/CheckBox/index.tsx +4 -0
- package/Consts/theme.ts +10 -10
- package/Context/index.ts +5 -1
- package/Divider/DashDivider.tsx +1 -0
- package/Divider/index.tsx +4 -0
- package/FoundationList/index.tsx +4 -0
- package/Icon/index.tsx +6 -6
- package/Icon/types.ts +1 -1
- package/IconButton/index.tsx +4 -12
- package/Image/index.tsx +9 -7
- package/Input/Input.tsx +8 -9
- package/Input/InputDropDown.tsx +10 -12
- package/Input/InputMoney.tsx +12 -8
- package/Input/InputMoneyView.tsx +14 -7
- package/Input/InputOTP.tsx +35 -33
- package/Input/InputPhoneNumber.tsx +8 -9
- package/Input/InputSearch.tsx +4 -6
- package/Input/InputTextArea.tsx +4 -0
- package/Input/SearchTextTyping.tsx +4 -0
- package/Input/SystemTextInput.tsx +7 -2
- package/Input/TextTyping.tsx +4 -0
- package/Input/common.tsx +26 -12
- package/Input/index.tsx +17 -20
- package/Input/moneyUtils.ts +10 -4
- package/Input/styles.ts +0 -5
- package/Input/utils.ts +14 -12
- package/Layout/Card.tsx +7 -4
- package/Layout/FloatingButton.tsx +4 -0
- package/Layout/Item.tsx +6 -2
- package/Layout/ItemList.tsx +9 -7
- package/Layout/ItemSectionList.tsx +2 -1
- package/Layout/ReservedRegions.tsx +25 -25
- package/Layout/Screen.tsx +56 -58
- package/Layout/Section.tsx +8 -5
- package/Layout/TrackingScope.tsx +1 -0
- package/Layout/screenContent.tsx +4 -2
- package/Layout/screenFooter.tsx +28 -18
- package/Layout/screenHeader.tsx +34 -31
- package/Layout/screenQuickReturn.tsx +17 -20
- package/Layout/screenScroll.ts +4 -7
- package/Layout/screenTypes.ts +3 -2
- package/Layout/types.ts +2 -4
- package/Layout/utils.ts +31 -37
- package/Loader/DotLoader.tsx +4 -0
- package/Loader/Loader.tsx +4 -0
- package/Loader/ProgressBar.tsx +1 -0
- package/Loader/Spinner.tsx +4 -0
- package/Loader/utils.ts +11 -7
- package/Pagination/Dot.tsx +4 -0
- package/Pagination/PaginationDot.tsx +1 -0
- package/Pagination/PaginationNumber.tsx +5 -3
- package/Pagination/PaginationScroll.tsx +5 -0
- package/Pagination/PaginationWhiteDot.tsx +1 -0
- package/Pagination/index.tsx +4 -0
- package/Pagination/types.ts +2 -2
- package/Popup/PopupNotify.tsx +44 -48
- package/Popup/PopupPromotion.tsx +4 -7
- package/Popup/types.ts +4 -4
- package/Popup/utils.ts +4 -0
- package/Radio/index.tsx +4 -0
- package/Skeleton/index.tsx +8 -0
- package/Switch/index.tsx +1 -0
- package/Tag/index.tsx +5 -1
- package/Tag/types.ts +3 -3
- package/Text/index.tsx +14 -3
- package/Text/styles.ts +1 -1
- package/Text/types.ts +1 -6
- package/Text/utils.ts +20 -4
- package/Title/index.tsx +41 -32
- package/ViewBoundary/index.tsx +4 -2
- package/index.ts +0 -6
- package/package.json +1 -1
- package/Application/KitAdoption/AdoptionBadge.tsx +0 -119
- package/Application/KitAdoption/AdoptionProbe.tsx +0 -166
- package/Application/KitAdoption/AdoptionStore.ts +0 -80
- package/Application/KitAdoption/Authorship/utils.ts +0 -137
- package/Application/KitAdoption/Slots/utils.ts +0 -68
- package/Application/KitAdoption/constants.ts +0 -120
- package/Application/KitAdoption/index.ts +0 -12
- package/Application/KitAdoption/styles.ts +0 -55
- package/Application/KitAdoption/types.ts +0 -61
- package/Application/KitAdoption/utils.ts +0 -376
- package/Application/__tests__/KitAdoption.integration.test.tsx +0 -253
- package/Application/__tests__/KitAdoption.test.ts +0 -283
- package/Application/__tests__/KitAdoptionAuthorship.test.ts +0 -132
- package/Application/__tests__/KitAdoptionStore.test.ts +0 -110
- package/Application/__tests__/KitAdoptionStructural.test.ts +0 -193
- package/Application/__tests__/modalLayout.test.ts +0 -128
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { createElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import { FIBER_TAG } from '../KitAdoption/constants';
|
|
4
|
-
import type { FiberLike, WalkResult } from '../KitAdoption/types';
|
|
5
|
-
import {
|
|
6
|
-
createRegistries,
|
|
7
|
-
getAdoptionTrackingParams,
|
|
8
|
-
isAdoptionTrackingEnabled,
|
|
9
|
-
walkScreen,
|
|
10
|
-
} from '../KitAdoption/utils';
|
|
11
|
-
|
|
12
|
-
const Button = () => null;
|
|
13
|
-
const RNView = () => null;
|
|
14
|
-
const RNFlatList = () => null;
|
|
15
|
-
const Cell = () => null;
|
|
16
|
-
const Item = () => null;
|
|
17
|
-
const Wrapper = () => null;
|
|
18
|
-
|
|
19
|
-
const registries = createRegistries([{ Button }], {
|
|
20
|
-
View: RNView,
|
|
21
|
-
FlatList: RNFlatList,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const makeFiber = (overrides: Partial<FiberLike> = {}): FiberLike => ({
|
|
25
|
-
tag: FIBER_TAG.FunctionComponent,
|
|
26
|
-
type: undefined,
|
|
27
|
-
child: null,
|
|
28
|
-
sibling: null,
|
|
29
|
-
return: null,
|
|
30
|
-
alternate: null,
|
|
31
|
-
memoizedProps: {},
|
|
32
|
-
...overrides,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
/** Sets children of parent (child, sibling, return links) and returns parent. */
|
|
36
|
-
const link = (parent: FiberLike, children: FiberLike[]): FiberLike => {
|
|
37
|
-
children.forEach((child, index) => {
|
|
38
|
-
child.return = parent;
|
|
39
|
-
child.sibling = children[index + 1] ?? null;
|
|
40
|
-
});
|
|
41
|
-
parent.child = children[0] ?? null;
|
|
42
|
-
return parent;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const hostView = (): FiberLike =>
|
|
46
|
-
makeFiber({ tag: FIBER_TAG.HostComponent, type: 'RCTView' });
|
|
47
|
-
|
|
48
|
-
const walkStructural = (root: FiberLike): WalkResult =>
|
|
49
|
-
walkScreen(root, registries, undefined, undefined, true);
|
|
50
|
-
|
|
51
|
-
const makeResult = (status: WalkResult['status']): WalkResult => ({
|
|
52
|
-
counts: { K: 3, R: 2, O: 1 },
|
|
53
|
-
kit: {},
|
|
54
|
-
rn: {},
|
|
55
|
-
other: {},
|
|
56
|
-
top_transparent: [],
|
|
57
|
-
fibers: 6,
|
|
58
|
-
truncated: false,
|
|
59
|
-
status,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
describe('KitAdoption walkScreen structural mode', () => {
|
|
63
|
-
it('counts a kit component once and skips internals outside its slots', () => {
|
|
64
|
-
const button = link(makeFiber({ type: Button }), [
|
|
65
|
-
link(makeFiber({ type: RNView }), [hostView()]),
|
|
66
|
-
]);
|
|
67
|
-
|
|
68
|
-
const result = walkStructural(button);
|
|
69
|
-
|
|
70
|
-
expect(result.counts).toEqual({ K: 1, R: 0, O: 0 });
|
|
71
|
-
expect(result.kit).toEqual({ Button: 1 });
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('counts an app element passed as children of a kit component', () => {
|
|
75
|
-
const child = createElement(RNView);
|
|
76
|
-
const internal = link(makeFiber({ type: RNView }), [
|
|
77
|
-
makeFiber({ type: RNView, memoizedProps: child.props }),
|
|
78
|
-
]);
|
|
79
|
-
const button = link(
|
|
80
|
-
makeFiber({ type: Button, memoizedProps: { children: child } }),
|
|
81
|
-
[internal],
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
const result = walkStructural(button);
|
|
85
|
-
|
|
86
|
-
expect(result.counts).toEqual({ K: 1, R: 1, O: 0 });
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('counts an RN View once, skips its host internal and counts app children', () => {
|
|
90
|
-
const child = createElement(Button);
|
|
91
|
-
const view = link(
|
|
92
|
-
makeFiber({ type: RNView, memoizedProps: { children: child } }),
|
|
93
|
-
[
|
|
94
|
-
link(hostView(), [
|
|
95
|
-
makeFiber({ type: Button, memoizedProps: child.props }),
|
|
96
|
-
]),
|
|
97
|
-
],
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const result = walkStructural(view);
|
|
101
|
-
|
|
102
|
-
expect(result.counts).toEqual({ K: 1, R: 1, O: 0 });
|
|
103
|
-
expect(result.rn).toEqual({ RNView: 1 });
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('counts the rendered item of a list cell as a slot', () => {
|
|
107
|
-
const itemElement = createElement(Item);
|
|
108
|
-
const item = makeFiber({ type: Button, memoizedProps: itemElement.props });
|
|
109
|
-
const wrapperView = link(
|
|
110
|
-
makeFiber({
|
|
111
|
-
type: RNView,
|
|
112
|
-
memoizedProps: { children: [itemElement, null] },
|
|
113
|
-
}),
|
|
114
|
-
[item],
|
|
115
|
-
);
|
|
116
|
-
const provider = link(makeFiber({ tag: FIBER_TAG.ContextProvider }), [
|
|
117
|
-
wrapperView,
|
|
118
|
-
]);
|
|
119
|
-
const cell = link(
|
|
120
|
-
makeFiber({
|
|
121
|
-
tag: FIBER_TAG.ClassComponent,
|
|
122
|
-
type: Cell,
|
|
123
|
-
memoizedProps: { cellKey: 'k', index: 0, item: {} },
|
|
124
|
-
}),
|
|
125
|
-
[provider],
|
|
126
|
-
);
|
|
127
|
-
const list = link(makeFiber({ type: RNFlatList }), [cell]);
|
|
128
|
-
|
|
129
|
-
const result = walkStructural(list);
|
|
130
|
-
|
|
131
|
-
expect(result.counts).toEqual({ K: 1, R: 1, O: 0 });
|
|
132
|
-
expect(result.rn).toEqual({ RNFlatList: 1 });
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('counts an O host component once and its app children', () => {
|
|
136
|
-
const child = createElement(Button);
|
|
137
|
-
const host = link(
|
|
138
|
-
makeFiber({
|
|
139
|
-
tag: FIBER_TAG.HostComponent,
|
|
140
|
-
type: 'custom-host',
|
|
141
|
-
memoizedProps: { children: child },
|
|
142
|
-
}),
|
|
143
|
-
[makeFiber({ type: Button, memoizedProps: child.props })],
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
const result = walkStructural(host);
|
|
147
|
-
|
|
148
|
-
expect(result.counts).toEqual({ K: 1, R: 0, O: 1 });
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('keeps counting internals when structural mode is off', () => {
|
|
152
|
-
const button = link(makeFiber({ type: RNView }), [
|
|
153
|
-
link(makeFiber({ type: Wrapper }), [makeFiber({ type: RNView })]),
|
|
154
|
-
]);
|
|
155
|
-
|
|
156
|
-
expect(walkStructural(button).counts.R).toBe(1);
|
|
157
|
-
expect(
|
|
158
|
-
walkScreen(button, registries, undefined, undefined, false).counts.R,
|
|
159
|
-
).toBe(2);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
describe('KitAdoption tracking helpers', () => {
|
|
164
|
-
it('enables tracking only for designSystemConfig.isWhiteList === true', () => {
|
|
165
|
-
expect(
|
|
166
|
-
isAdoptionTrackingEnabled({ designSystemConfig: { isWhiteList: true } }),
|
|
167
|
-
).toBe(true);
|
|
168
|
-
expect(
|
|
169
|
-
isAdoptionTrackingEnabled({
|
|
170
|
-
designSystemConfig: { isWhiteList: 'true' },
|
|
171
|
-
}),
|
|
172
|
-
).toBe(false);
|
|
173
|
-
expect(isAdoptionTrackingEnabled({ designSystemConfig: {} })).toBe(false);
|
|
174
|
-
expect(isAdoptionTrackingEnabled({})).toBe(false);
|
|
175
|
-
expect(isAdoptionTrackingEnabled(undefined)).toBe(false);
|
|
176
|
-
expect(isAdoptionTrackingEnabled('x')).toBe(false);
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
it('maps an ok result to analytics params', () => {
|
|
180
|
-
expect(getAdoptionTrackingParams(makeResult('ok'))).toEqual({
|
|
181
|
-
num_design_system: 3,
|
|
182
|
-
num_rn: 2,
|
|
183
|
-
num_other: 1,
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
it('returns undefined for any other status or no result', () => {
|
|
188
|
-
expect(getAdoptionTrackingParams(makeResult('error'))).toBeUndefined();
|
|
189
|
-
expect(getAdoptionTrackingParams(makeResult('dev_bundle'))).toBeUndefined();
|
|
190
|
-
expect(getAdoptionTrackingParams(makeResult('truncated'))).toBeUndefined();
|
|
191
|
-
expect(getAdoptionTrackingParams(undefined)).toBeUndefined();
|
|
192
|
-
});
|
|
193
|
-
});
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// document/__mocks__ shadows react-native with react-native-web for the doc site
|
|
2
|
-
jest.mock('react-native', () => jest.requireActual('react-native'));
|
|
3
|
-
|
|
4
|
-
import { getModalLayout } from '../modalLayout';
|
|
5
|
-
|
|
6
|
-
const NO_INSETS = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
7
|
-
|
|
8
|
-
describe('getModalLayout', () => {
|
|
9
|
-
it('keeps the phone look', () => {
|
|
10
|
-
const layout = getModalLayout({
|
|
11
|
-
width: 390,
|
|
12
|
-
height: 844,
|
|
13
|
-
insets: { top: 47, right: 0, bottom: 34, left: 0 },
|
|
14
|
-
isDuo: false,
|
|
15
|
-
});
|
|
16
|
-
expect(layout.isFoldable).toBe(false);
|
|
17
|
-
expect(layout.popup.width).toBe(342);
|
|
18
|
-
expect(layout.popup.maxHeight).toBeUndefined();
|
|
19
|
-
expect(layout.popup.radius).toBe(16);
|
|
20
|
-
expect(layout.sheet.width).toBeUndefined();
|
|
21
|
-
expect(layout.sheet.maxHeight).toBeUndefined();
|
|
22
|
-
expect(layout.sheet.radius).toBe(12);
|
|
23
|
-
expect(layout.scrimOpacity).toBe(0.6);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('keeps the phone look in landscape', () => {
|
|
27
|
-
const layout = getModalLayout({
|
|
28
|
-
width: 844,
|
|
29
|
-
height: 390,
|
|
30
|
-
insets: { top: 0, right: 47, bottom: 21, left: 47 },
|
|
31
|
-
isDuo: false,
|
|
32
|
-
});
|
|
33
|
-
expect(layout.isFoldable).toBe(false);
|
|
34
|
-
expect(layout.popup.width).toBe(844 - 48);
|
|
35
|
-
expect(layout.popup.maxHeight).toBeUndefined();
|
|
36
|
-
expect(layout.popup.radius).toBe(16);
|
|
37
|
-
expect(layout.sheet.width).toBeUndefined();
|
|
38
|
-
expect(layout.scrimOpacity).toBe(0.6);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('caps popup and sheet on a wide foldable window', () => {
|
|
42
|
-
const layout = getModalLayout({
|
|
43
|
-
width: 884,
|
|
44
|
-
height: 1104,
|
|
45
|
-
insets: { top: 24, right: 0, bottom: 20, left: 0 },
|
|
46
|
-
isDuo: false,
|
|
47
|
-
});
|
|
48
|
-
expect(layout.isFoldable).toBe(true);
|
|
49
|
-
expect(layout.popup).toMatchObject({
|
|
50
|
-
width: 450,
|
|
51
|
-
minWidth: 280,
|
|
52
|
-
maxWidth: 450,
|
|
53
|
-
maxHeight: 600,
|
|
54
|
-
margin: 24,
|
|
55
|
-
radius: 24,
|
|
56
|
-
});
|
|
57
|
-
expect(layout.sheet).toMatchObject({
|
|
58
|
-
width: 653,
|
|
59
|
-
maxHeight: 1104 - 24 - 12,
|
|
60
|
-
minHeight: 230,
|
|
61
|
-
margin: 12,
|
|
62
|
-
radius: 24,
|
|
63
|
-
});
|
|
64
|
-
expect(layout.scrimOpacity).toBe(0.2);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('limits popup height to the safe area minus 48', () => {
|
|
68
|
-
const layout = getModalLayout({
|
|
69
|
-
width: 900,
|
|
70
|
-
height: 600,
|
|
71
|
-
insets: { top: 24, right: 0, bottom: 20, left: 0 },
|
|
72
|
-
isDuo: false,
|
|
73
|
-
});
|
|
74
|
-
expect(layout.popup.maxHeight).toBe(600 - 24 - 20 - 48);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('places modals left of the control column on the iPhone Duo outer display', () => {
|
|
78
|
-
const layout = getModalLayout({
|
|
79
|
-
width: 420,
|
|
80
|
-
height: 760,
|
|
81
|
-
insets: { top: 0, right: 64, bottom: 20, left: 0 },
|
|
82
|
-
isDuo: true,
|
|
83
|
-
});
|
|
84
|
-
expect(layout.isFoldable).toBe(true);
|
|
85
|
-
expect(layout.placement).toEqual({ x: 0, y: 0, width: 356, height: 740 });
|
|
86
|
-
expect(layout.popup.margin).toBe(12);
|
|
87
|
-
expect(layout.popup.width).toBe(356 - 24);
|
|
88
|
-
expect(layout.sheet.width).toBe(356 - 24);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('never grows past the margins when the space is under the min width', () => {
|
|
92
|
-
const layout = getModalLayout({
|
|
93
|
-
width: 300,
|
|
94
|
-
height: 600,
|
|
95
|
-
insets: NO_INSETS,
|
|
96
|
-
isDuo: true,
|
|
97
|
-
});
|
|
98
|
-
expect(layout.popup.width).toBe(300 - 24);
|
|
99
|
-
expect(layout.popup.minWidth).toBe(300 - 24);
|
|
100
|
-
expect(layout.sheet.width).toBe(300 - 24);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('moves to the right half when iPhone Duo is half folded', () => {
|
|
104
|
-
const layout = getModalLayout({
|
|
105
|
-
width: 1000,
|
|
106
|
-
height: 800,
|
|
107
|
-
insets: NO_INSETS,
|
|
108
|
-
isDuo: true,
|
|
109
|
-
hinge: { x: 495, y: 0, width: 10, height: 800 },
|
|
110
|
-
});
|
|
111
|
-
expect(layout.placement).toEqual({ x: 505, y: 0, width: 495, height: 800 });
|
|
112
|
-
expect(layout.popup.margin).toBe(12);
|
|
113
|
-
expect(layout.popup.width).toBe(450);
|
|
114
|
-
expect(layout.sheet.width).toBe(495 - 24);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('ignores a division off the iPhone Duo', () => {
|
|
118
|
-
const layout = getModalLayout({
|
|
119
|
-
width: 1000,
|
|
120
|
-
height: 800,
|
|
121
|
-
insets: NO_INSETS,
|
|
122
|
-
isDuo: false,
|
|
123
|
-
hinge: { x: 495, y: 0, width: 10, height: 800 },
|
|
124
|
-
});
|
|
125
|
-
expect(layout.placement.x).toBe(0);
|
|
126
|
-
expect(layout.popup.margin).toBe(24);
|
|
127
|
-
});
|
|
128
|
-
});
|