@adobe-commerce/elsie 1.0.0-alpha4 → 1.0.0-beta1
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/.elsie.js +9 -0
- package/.eslintrc.js +9 -0
- package/__mocks__/svg.js +9 -0
- package/bin/lib/validate-typeof.js +9 -0
- package/bin/lib/write-file.js +9 -0
- package/bin/lib/write-parent-index.js +9 -0
- package/config/eslint.js +9 -0
- package/config/jest.js +9 -0
- package/config/prettier.js +9 -0
- package/config/setEnvVars.js +9 -0
- package/config/storybook/addon.js +9 -0
- package/config/storybook/components/FileTree/FileTree.jsx +9 -0
- package/config/storybook/components/FileTree/index.js +9 -0
- package/config/storybook/components/Flex/Flex.jsx +9 -0
- package/config/storybook/components/Flex/Flex.module.css +9 -0
- package/config/storybook/components/Flex/index.js +9 -0
- package/config/storybook/components/OptionsTable/OptionsTable.jsx +9 -0
- package/config/storybook/components/OptionsTable/OptionsTable.module.css +9 -0
- package/config/storybook/components/OptionsTable/index.js +9 -0
- package/config/storybook/components/Panel/Panel.module.css +9 -0
- package/config/storybook/components/Panel/Panel.tsx +9 -0
- package/config/storybook/components/Panel/index.ts +9 -0
- package/config/storybook/components/Screenshot/Screenshot.jsx +9 -0
- package/config/storybook/components/Screenshot/Screenshot.module.css +9 -0
- package/config/storybook/components/Screenshot/index.js +9 -0
- package/config/storybook/components/Steps/Steps.jsx +9 -0
- package/config/storybook/components/Steps/Steps.module.css +9 -0
- package/config/storybook/components/Steps/index.js +9 -0
- package/config/storybook/components/StoryWrapper/StoryWrapper.jsx +9 -0
- package/config/storybook/components/StoryWrapper/StoryWrapper.module.css +9 -0
- package/config/storybook/components/StoryWrapper/index.js +9 -0
- package/config/storybook/components/Summary/Summary.jsx +9 -0
- package/config/storybook/components/Summary/Summary.module.css +9 -0
- package/config/storybook/components/Summary/index.js +9 -0
- package/config/storybook/components/Variants/Variants.js +9 -0
- package/config/storybook/components/Variants/docs.css +9 -0
- package/config/storybook/components/Variants/index.js +9 -0
- package/config/storybook/components/video/index.jsx +9 -0
- package/config/storybook/manager.js +9 -0
- package/config/storybook/preview.jsx +9 -0
- package/config/storybook/theming/fonts.css +9 -0
- package/config/storybook/theming/manager.css +9 -0
- package/config/storybook/theming/preview.css +9 -0
- package/config/storybook/theming/theme.js +9 -0
- package/config/vite.mjs +9 -0
- package/package.json +1 -1
- package/post-release.sh +5 -0
- package/src/components/Accordion/Accordion.css +10 -1
- package/src/components/Accordion/Accordion.stories.tsx +9 -0
- package/src/components/Accordion/Accordion.tsx +9 -0
- package/src/components/Accordion/index.ts +9 -0
- package/src/components/ActionButton/ActionButton.css +9 -0
- package/src/components/ActionButton/ActionButton.stories.tsx +9 -0
- package/src/components/ActionButton/ActionButton.tsx +9 -0
- package/src/components/ActionButton/index.ts +9 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.css +9 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx +9 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.tsx +9 -0
- package/src/components/ActionButtonGroup/index.ts +9 -0
- package/src/components/AlertBanner/AlertBanner.css +9 -0
- package/src/components/AlertBanner/AlertBanner.stories.tsx +9 -0
- package/src/components/AlertBanner/AlertBanner.tsx +9 -0
- package/src/components/AlertBanner/index.ts +9 -0
- package/src/components/Breadcrumbs/Breadcrumbs.css +9 -0
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +9 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -0
- package/src/components/Breadcrumbs/index.ts +9 -0
- package/src/components/Button/Button.css +9 -0
- package/src/components/Button/Button.stories.tsx +9 -0
- package/src/components/Button/Button.tsx +9 -0
- package/src/components/Button/index.ts +9 -0
- package/src/components/Card/Card.css +9 -0
- package/src/components/Card/Card.stories.tsx +9 -0
- package/src/components/Card/Card.tsx +9 -0
- package/src/components/Card/index.ts +9 -0
- package/src/components/CartItem/CartItem.css +40 -5
- package/src/components/CartItem/CartItem.stories.tsx +84 -44
- package/src/components/CartItem/CartItem.tsx +343 -320
- package/src/components/CartItem/CartItemSkeleton.tsx +9 -0
- package/src/components/CartItem/index.ts +9 -0
- package/src/components/CartList/CartList.css +9 -0
- package/src/components/CartList/CartList.stories.tsx +9 -0
- package/src/components/CartList/CartList.tsx +9 -0
- package/src/components/CartList/index.ts +9 -0
- package/src/components/Checkbox/Checkbox.css +9 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +9 -0
- package/src/components/Checkbox/Checkbox.tsx +9 -0
- package/src/components/Checkbox/index.ts +9 -0
- package/src/components/ColorSwatch/ColorSwatch.css +9 -0
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +9 -0
- package/src/components/ColorSwatch/ColorSwatch.tsx +9 -0
- package/src/components/ColorSwatch/index.ts +9 -0
- package/src/components/ContentGrid/ContentGrid.css +3 -11
- package/src/components/ContentGrid/ContentGrid.stories.tsx +3 -11
- package/src/components/ContentGrid/ContentGrid.tsx +3 -11
- package/src/components/ContentGrid/index.ts +3 -11
- package/src/components/Divider/Divider.css +9 -0
- package/src/components/Divider/Divider.stories.tsx +9 -0
- package/src/components/Divider/Divider.tsx +9 -0
- package/src/components/Divider/index.ts +9 -0
- package/src/components/Field/Field.css +9 -0
- package/src/components/Field/Field.stories.tsx +9 -0
- package/src/components/Field/Field.tsx +9 -0
- package/src/components/Field/index.ts +9 -0
- package/src/components/Header/Header.css +9 -0
- package/src/components/Header/Header.stories.tsx +52 -0
- package/src/components/Header/Header.tsx +31 -3
- package/src/components/Header/index.ts +9 -0
- package/src/components/Icon/Icon.css +9 -0
- package/src/components/Icon/Icon.stories.helpers.jsx +9 -0
- package/src/components/Icon/Icon.stories.tsx +9 -0
- package/src/components/Icon/Icon.tsx +9 -0
- package/src/components/Icon/index.ts +9 -0
- package/src/components/IllustratedMessage/IllustratedMessage.css +9 -0
- package/src/components/IllustratedMessage/IllustratedMessage.stories.tsx +9 -0
- package/src/components/IllustratedMessage/IllustratedMessage.tsx +9 -0
- package/src/components/IllustratedMessage/index.ts +9 -0
- package/src/components/Image/Image.css +9 -0
- package/src/components/Image/Image.stories.tsx +9 -0
- package/src/components/Image/Image.tsx +9 -0
- package/src/components/Image/index.ts +9 -0
- package/src/components/ImageSwatch/ImageSwatch.css +9 -0
- package/src/components/ImageSwatch/ImageSwatch.stories.tsx +58 -0
- package/src/components/ImageSwatch/ImageSwatch.tsx +22 -10
- package/src/components/ImageSwatch/index.ts +9 -0
- package/src/components/InLineAlert/InLineAlert.css +9 -0
- package/src/components/InLineAlert/InLineAlert.stories.tsx +9 -0
- package/src/components/InLineAlert/InLineAlert.tsx +9 -0
- package/src/components/InLineAlert/index.ts +9 -0
- package/src/components/Incrementer/Incrementer.css +9 -0
- package/src/components/Incrementer/Incrementer.stories.tsx +9 -0
- package/src/components/Incrementer/Incrementer.tsx +9 -0
- package/src/components/Incrementer/index.ts +9 -0
- package/src/components/Input/Input.css +9 -0
- package/src/components/Input/Input.stories.tsx +9 -0
- package/src/components/Input/Input.tsx +9 -0
- package/src/components/Input/index.ts +9 -0
- package/src/components/InputDate/InputDate.css +9 -0
- package/src/components/InputDate/InputDate.stories.tsx +9 -0
- package/src/components/InputDate/InputDate.tsx +9 -0
- package/src/components/InputDate/index.ts +9 -0
- package/src/components/InputPassword/InputPassword.css +9 -0
- package/src/components/InputPassword/InputPassword.stories.tsx +9 -0
- package/src/components/InputPassword/InputPassword.tsx +9 -0
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.css +9 -0
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.tsx +9 -0
- package/src/components/InputPassword/PasswordStatusIndicator/index.ts +9 -0
- package/src/components/InputPassword/index.ts +9 -0
- package/src/components/Modal/Modal.css +8 -13
- package/src/components/Modal/Modal.stories.tsx +8 -13
- package/src/components/Modal/Modal.tsx +8 -13
- package/src/components/Modal/index.ts +8 -13
- package/src/components/Pagination/Pagination.css +9 -0
- package/src/components/Pagination/Pagination.stories.tsx +9 -0
- package/src/components/Pagination/Pagination.tsx +9 -0
- package/src/components/Pagination/index.ts +9 -0
- package/src/components/Picker/Picker.css +9 -0
- package/src/components/Picker/Picker.stories.tsx +9 -0
- package/src/components/Picker/Picker.tsx +9 -0
- package/src/components/Picker/index.ts +9 -0
- package/src/components/Price/Price.css +9 -0
- package/src/components/Price/Price.stories.tsx +9 -0
- package/src/components/Price/Price.tsx +9 -0
- package/src/components/Price/index.ts +9 -0
- package/src/components/PriceRange/PriceRange.css +9 -0
- package/src/components/PriceRange/PriceRange.stories.tsx +9 -0
- package/src/components/PriceRange/PriceRange.tsx +9 -0
- package/src/components/PriceRange/index.ts +9 -0
- package/src/components/ProgressSpinner/ProgressSpinner.css +9 -0
- package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +9 -0
- package/src/components/ProgressSpinner/ProgressSpinner.tsx +9 -0
- package/src/components/ProgressSpinner/index.ts +9 -0
- package/src/components/RadioButton/RadioButton.css +9 -0
- package/src/components/RadioButton/RadioButton.stories.tsx +9 -0
- package/src/components/RadioButton/RadioButton.tsx +9 -0
- package/src/components/RadioButton/index.ts +9 -0
- package/src/components/Skeleton/Skeleton.css +9 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +9 -0
- package/src/components/Skeleton/Skeleton.tsx +9 -0
- package/src/components/Skeleton/index.ts +9 -0
- package/src/components/Tag/Tag.css +9 -0
- package/src/components/Tag/Tag.stories.tsx +9 -0
- package/src/components/Tag/Tag.tsx +9 -0
- package/src/components/Tag/index.ts +9 -0
- package/src/components/TextArea/TextArea.css +9 -0
- package/src/components/TextArea/TextArea.stories.tsx +9 -0
- package/src/components/TextArea/TextArea.tsx +9 -0
- package/src/components/TextArea/index.ts +9 -0
- package/src/components/TextSwatch/TextSwatch.css +9 -0
- package/src/components/TextSwatch/TextSwatch.stories.tsx +9 -0
- package/src/components/TextSwatch/TextSwatch.tsx +9 -0
- package/src/components/TextSwatch/index.ts +9 -0
- package/src/components/ToggleButton/ToggleButton.css +18 -0
- package/src/components/ToggleButton/ToggleButton.stories.tsx +47 -3
- package/src/components/ToggleButton/ToggleButton.tsx +19 -11
- package/src/components/ToggleButton/index.ts +9 -0
- package/src/components/UIProvider/UIProvider.css +9 -0
- package/src/components/UIProvider/UIProvider.tsx +9 -0
- package/src/components/UIProvider/debugger.css +9 -0
- package/src/components/UIProvider/index.ts +9 -0
- package/src/components/UIProvider/normalize.css +9 -0
- package/src/components/index.ts +9 -0
- package/src/i18n/index.ts +9 -0
- package/src/lib/classes.ts +9 -0
- package/src/lib/config.ts +9 -0
- package/src/lib/debounce.ts +9 -0
- package/src/lib/deepmerge.ts +9 -0
- package/src/lib/deviceUtils.ts +9 -0
- package/src/lib/form-values.ts +9 -0
- package/src/lib/i18n.ts +9 -0
- package/src/lib/image-params-keymap.ts +9 -0
- package/src/lib/index.ts +9 -0
- package/src/lib/initializer.ts +9 -0
- package/src/lib/is-number.ts +9 -0
- package/src/lib/render.tsx +9 -0
- package/src/lib/resolve-image.ts +9 -0
- package/src/lib/signals.ts +9 -0
- package/src/lib/slot.tsx +9 -0
- package/src/lib/tests.tsx +9 -0
- package/src/lib/types.ts +9 -0
- package/src/lib/vcomponent.tsx +8 -13
- package/static/assets/images/index.ts +9 -0
- package/storybook-stories.js +9 -0
- package/tests/__mocks__/browserMocks.ts +9 -0
- package/tests/__mocks__/fileMocks.ts +9 -0
- package/types/icons.d.ts +9 -0
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import { expect, within, userEvent } from '@storybook/test';
|
|
@@ -8,7 +17,7 @@ import {
|
|
|
8
17
|
CartItem as component,
|
|
9
18
|
CartItemProps,
|
|
10
19
|
CartItemSkeleton,
|
|
11
|
-
Icon,
|
|
20
|
+
Icon, Button,
|
|
12
21
|
} from '@adobe-commerce/elsie/components';
|
|
13
22
|
import { WarningWithCircle } from '@adobe-commerce/elsie/icons';
|
|
14
23
|
|
|
@@ -34,13 +43,13 @@ const meta: Meta<CartItemProps> = {
|
|
|
34
43
|
options: ['Image', 'None'],
|
|
35
44
|
mapping: {
|
|
36
45
|
Image: (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
<Image
|
|
47
|
+
src="https://picsum.photos/132/184"
|
|
48
|
+
width="132"
|
|
49
|
+
height="184"
|
|
50
|
+
alt="Some alternative text"
|
|
51
|
+
loading="lazy"
|
|
52
|
+
/>
|
|
44
53
|
),
|
|
45
54
|
None: undefined,
|
|
46
55
|
},
|
|
@@ -74,9 +83,9 @@ const meta: Meta<CartItemProps> = {
|
|
|
74
83
|
options: ['Description', 'None'],
|
|
75
84
|
mapping: {
|
|
76
85
|
Description: (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
<div>
|
|
87
|
+
Secondary product information such as brand name, description, etc.
|
|
88
|
+
</div>
|
|
80
89
|
),
|
|
81
90
|
None: undefined,
|
|
82
91
|
},
|
|
@@ -109,12 +118,12 @@ const meta: Meta<CartItemProps> = {
|
|
|
109
118
|
options: ['Attributes', 'none'],
|
|
110
119
|
mapping: {
|
|
111
120
|
Attributes: (
|
|
112
|
-
<div>
|
|
113
121
|
<div>
|
|
114
|
-
|
|
122
|
+
<div>
|
|
123
|
+
Activity: Gym, Hiking, Overnight, School, Trail, Travel, Urban
|
|
124
|
+
</div>
|
|
125
|
+
<div>Material: Nylon, Polyester</div>
|
|
115
126
|
</div>
|
|
116
|
-
<div>Material: Nylon, Polyester</div>
|
|
117
|
-
</div>
|
|
118
127
|
),
|
|
119
128
|
none: undefined,
|
|
120
129
|
},
|
|
@@ -161,10 +170,10 @@ const meta: Meta<CartItemProps> = {
|
|
|
161
170
|
options: ['Total', 'Final', 'None'],
|
|
162
171
|
mapping: {
|
|
163
172
|
Total: (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
173
|
+
<>
|
|
174
|
+
<Price amount={59.98} variant="strikethrough" />
|
|
175
|
+
<Price amount={55.95} sale />
|
|
176
|
+
</>
|
|
168
177
|
),
|
|
169
178
|
Final: <Price amount={55.95} sale />,
|
|
170
179
|
None: undefined,
|
|
@@ -183,9 +192,9 @@ const meta: Meta<CartItemProps> = {
|
|
|
183
192
|
options: ['totalExcludingTax', 'None'],
|
|
184
193
|
mapping: {
|
|
185
194
|
totalExcludingTax: (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
<>
|
|
196
|
+
<Price amount={53.99} weight="normal" />
|
|
197
|
+
</>
|
|
189
198
|
),
|
|
190
199
|
None: undefined,
|
|
191
200
|
},
|
|
@@ -268,9 +277,9 @@ const meta: Meta<CartItemProps> = {
|
|
|
268
277
|
mapping: {
|
|
269
278
|
none: null,
|
|
270
279
|
RunningOut: (
|
|
271
|
-
|
|
280
|
+
<span>
|
|
272
281
|
<Icon source={WarningWithCircle} size={'16'} aria-hidden={true} />{' '}
|
|
273
|
-
|
|
282
|
+
Out of stock!
|
|
274
283
|
</span>
|
|
275
284
|
),
|
|
276
285
|
},
|
|
@@ -311,6 +320,31 @@ const meta: Meta<CartItemProps> = {
|
|
|
311
320
|
description: 'Name for the component.',
|
|
312
321
|
table: { defaultValue: { summary: 'null' } },
|
|
313
322
|
},
|
|
323
|
+
actions: {
|
|
324
|
+
control: {
|
|
325
|
+
type: 'select',
|
|
326
|
+
labels: {
|
|
327
|
+
Button: 'Button',
|
|
328
|
+
None: 'None'
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
description: 'Wishlist control.',
|
|
332
|
+
options: ['Button', 'None'],
|
|
333
|
+
mapping: {
|
|
334
|
+
Button: (
|
|
335
|
+
<Button
|
|
336
|
+
size="medium"
|
|
337
|
+
type="submit"
|
|
338
|
+
icon={<Icon source="Heart" />}
|
|
339
|
+
variant="tertiary"
|
|
340
|
+
>
|
|
341
|
+
Move to wishlist
|
|
342
|
+
</Button>
|
|
343
|
+
),
|
|
344
|
+
None: undefined,
|
|
345
|
+
},
|
|
346
|
+
table: { defaultValue: { summary: 'null' } },
|
|
347
|
+
},
|
|
314
348
|
footer: {
|
|
315
349
|
control: {
|
|
316
350
|
type: 'check',
|
|
@@ -325,19 +359,19 @@ const meta: Meta<CartItemProps> = {
|
|
|
325
359
|
mapping: {
|
|
326
360
|
Promotions: <div>Extra 20% Off Clearance with Code: EXTRA20</div>,
|
|
327
361
|
Delivery: (
|
|
328
|
-
<div>
|
|
329
|
-
<div>Free Shipping</div>
|
|
330
362
|
<div>
|
|
331
|
-
|
|
332
|
-
<
|
|
363
|
+
<div>Free Shipping</div>
|
|
364
|
+
<div>
|
|
365
|
+
Delivery Estimate
|
|
366
|
+
<p>Order now for delivery Aug 26 - Aug 28 to ZIP code: 80201</p>
|
|
367
|
+
</div>
|
|
333
368
|
</div>
|
|
334
|
-
</div>
|
|
335
369
|
),
|
|
336
370
|
Returns: (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
371
|
+
<div>
|
|
372
|
+
Final-sale items, identified by a price ending in .99 or .97, cannot
|
|
373
|
+
be canceled or returned.
|
|
374
|
+
</div>
|
|
341
375
|
),
|
|
342
376
|
},
|
|
343
377
|
table: { defaultValue: { summary: 'null' } },
|
|
@@ -384,6 +418,7 @@ type Story = StoryObj<CartItemProps>;
|
|
|
384
418
|
* alert={<span><Icon source={WarningWithCircle} size={'16'} /> Out of stock!</span>}
|
|
385
419
|
* discount={<div>50% off</div>}
|
|
386
420
|
* savings={<div>$25 Savings</div>}
|
|
421
|
+
* actions={<div>Wishlist</div>}
|
|
387
422
|
* configurations={{ Color: 'Blue', Size: 'L' }}
|
|
388
423
|
* onRemove={() => console.log('onRemove')}
|
|
389
424
|
* onQuantity={(value) => console.log('onQuantity', value)}
|
|
@@ -404,6 +439,7 @@ export const CartItem: Story = {
|
|
|
404
439
|
description: 'Description' as any,
|
|
405
440
|
discount: 'none' as any,
|
|
406
441
|
savings: 'none' as any,
|
|
442
|
+
actions: 'Button' as any,
|
|
407
443
|
footer: null as any,
|
|
408
444
|
warning: 'none' as any,
|
|
409
445
|
alert: 'none' as any,
|
|
@@ -417,47 +453,51 @@ export const CartItem: Story = {
|
|
|
417
453
|
},
|
|
418
454
|
play: async () => {
|
|
419
455
|
const canvasElement = document.querySelector(
|
|
420
|
-
|
|
456
|
+
'#storybook-root'
|
|
421
457
|
) as HTMLElement;
|
|
422
458
|
const canvas = within(canvasElement);
|
|
423
459
|
|
|
424
460
|
const itemImage = document.querySelector(
|
|
425
|
-
|
|
461
|
+
'.dropin-cart-item__image'
|
|
426
462
|
) as HTMLElement;
|
|
427
463
|
expect(itemImage).toBeVisible();
|
|
428
464
|
const itemTitle = document.querySelector(
|
|
429
|
-
|
|
465
|
+
'.dropin-cart-item__title'
|
|
430
466
|
) as HTMLElement;
|
|
431
467
|
expect(itemTitle).toBeVisible();
|
|
432
468
|
const itemSku = document.querySelector(
|
|
433
|
-
|
|
469
|
+
'.dropin-cart-item__sku'
|
|
434
470
|
) as HTMLElement;
|
|
435
471
|
expect(itemSku).toBeVisible();
|
|
436
472
|
const itemConfigurations = document.querySelector(
|
|
437
|
-
|
|
473
|
+
'.dropin-cart-item__configurations'
|
|
438
474
|
) as HTMLElement;
|
|
439
475
|
expect(itemConfigurations).toBeVisible();
|
|
440
476
|
const itemPrice = document.querySelector(
|
|
441
|
-
|
|
477
|
+
'.dropin-cart-item__price'
|
|
442
478
|
) as HTMLElement;
|
|
443
479
|
expect(itemPrice).toBeVisible();
|
|
444
480
|
const quantityStepper = document.querySelector(
|
|
445
|
-
|
|
481
|
+
'.dropin-cart-item__quantity'
|
|
446
482
|
) as HTMLElement;
|
|
447
483
|
expect(quantityStepper).toBeVisible();
|
|
448
484
|
const itemTotal = document.querySelector(
|
|
449
|
-
|
|
485
|
+
'.dropin-cart-item__total'
|
|
450
486
|
) as HTMLElement;
|
|
451
487
|
expect(itemTotal).toBeVisible();
|
|
488
|
+
const actions = document.querySelector(
|
|
489
|
+
'.dropin-cart-item__buttons'
|
|
490
|
+
) as HTMLElement;
|
|
491
|
+
expect(actions).toBeVisible();
|
|
452
492
|
|
|
453
493
|
const increaseButton = document.querySelector(
|
|
454
|
-
|
|
494
|
+
'button[aria-label="Increase Quantity"]'
|
|
455
495
|
) as HTMLElement;
|
|
456
496
|
const decreaseButton = document.querySelector(
|
|
457
|
-
|
|
497
|
+
'button[aria-label="Decrease Quantity"]'
|
|
458
498
|
) as HTMLElement;
|
|
459
499
|
|
|
460
|
-
// Without this wait test failing intermittently as click event is
|
|
500
|
+
// Without this wait test failing intermittently as click event is triggering before even element fully loaded
|
|
461
501
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
462
502
|
await userEvent.click(increaseButton);
|
|
463
503
|
await expect(await canvas.findByDisplayValue('2')).toBeTruthy();
|