@12-apps/ui 1.5.0 → 1.5.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/package.json +17 -9
- package/src/button/index.ts +1 -0
- package/src/social-login-button/index.ts +1 -0
- package/src/{social-login-button.tsx → social-login-button/social-login-button.tsx} +5 -5
- package/src/user-avatar/index.ts +1 -0
- package/src/{user-avatar.tsx → user-avatar/user-avatar.tsx} +4 -4
- package/eslint.config.js +0 -89
- package/src/__tests__/data-grid.test.tsx +0 -125
- package/src/__tests__/package-wiring.test.ts +0 -41
- package/src/__tests__/setup.ts +0 -1
- package/src/__tests__/social-login-button.test.tsx +0 -186
- package/src/__tests__/user-avatar.test.tsx +0 -195
- package/src/__tests__/viewport.test.ts +0 -50
- package/src/components/command/__tests__/command.test.tsx +0 -112
- package/src/components/data-display/Alert/Alert.stories.tsx +0 -559
- package/src/components/data-display/Alert/Alert.test.stories.tsx +0 -707
- package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +0 -362
- package/src/components/data-display/AlertDialog/AlertDialog.test.stories.tsx +0 -763
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.stories.tsx +0 -230
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +0 -270
- package/src/components/data-display/Avatar/Avatar.stories.tsx +0 -721
- package/src/components/data-display/Avatar/Avatar.test.stories.tsx +0 -822
- package/src/components/data-display/Badge/Badge.stories.tsx +0 -1134
- package/src/components/data-display/Badge/Badge.test.stories.tsx +0 -1194
- package/src/components/data-display/Banner/Banner.stories.tsx +0 -528
- package/src/components/data-display/Banner/Banner.test.stories.tsx +0 -511
- package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
- package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -701
- package/src/components/data-display/Chart/Chart.stories.tsx +0 -568
- package/src/components/data-display/Chart/Chart.test.stories.tsx +0 -174
- package/src/components/data-display/Chart/SpecChart.stories.tsx +0 -150
- package/src/components/data-display/Chart/SpecChart.test.stories.tsx +0 -56
- package/src/components/data-display/Chart/__tests__/SpecChart.test.tsx +0 -60
- package/src/components/data-display/Chart/__tests__/chart-format.test.ts +0 -43
- package/src/components/data-display/Chart/__tests__/chart-spec.test.ts +0 -119
- package/src/components/data-display/Chip/Chip.stories.tsx +0 -252
- package/src/components/data-display/Chip/Chip.test.stories.tsx +0 -266
- package/src/components/data-display/DataGrid/DataGrid.stories.tsx +0 -515
- package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +0 -653
- package/src/components/data-display/DataViews/__tests__/DataViewsGrid.test.tsx +0 -271
- package/src/components/data-display/DataViews/__tests__/DataViewsTableBase.test.tsx +0 -134
- package/src/components/data-display/DataViews/__tests__/SaveViewModal.test.tsx +0 -83
- package/src/components/data-display/DataViews/__tests__/data-views-filter.test.ts +0 -115
- package/src/components/data-display/DataViews/__tests__/data-views-preview.test.ts +0 -53
- package/src/components/data-display/DataViews/__tests__/range-pill.test.tsx +0 -114
- package/src/components/data-display/DataViews/base-card.stories.tsx +0 -136
- package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +0 -254
- package/src/components/data-display/EmptyState/EmptyState.stories.tsx +0 -282
- package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +0 -441
- package/src/components/data-display/ErrorState/ErrorState.stories.tsx +0 -110
- package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +0 -133
- package/src/components/data-display/HoverCard/HoverCard.stories.tsx +0 -650
- package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +0 -929
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.stories.tsx +0 -411
- package/src/components/data-display/LazyImage/LazyImage.stories.tsx +0 -387
- package/src/components/data-display/Lightbox/Lightbox.stories.tsx +0 -315
- package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +0 -598
- package/src/components/data-display/LoadingState/LoadingState.stories.tsx +0 -124
- package/src/components/data-display/LoadingState/LoadingState.test.stories.tsx +0 -99
- package/src/components/data-display/MapPreview/MapPreview.stories.tsx +0 -458
- package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +0 -394
- package/src/components/data-display/Popover/Popover.stories.tsx +0 -295
- package/src/components/data-display/Popover/Popover.test.stories.tsx +0 -1162
- package/src/components/data-display/Progress/Progress.stories.tsx +0 -481
- package/src/components/data-display/Progress/Progress.test.stories.tsx +0 -2070
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +0 -160
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.test.stories.tsx +0 -190
- package/src/components/data-display/Sheet/Sheet.stories.tsx +0 -883
- package/src/components/data-display/Sheet/Sheet.test.stories.tsx +0 -1105
- package/src/components/data-display/StatCard/StatCard.stories.tsx +0 -167
- package/src/components/data-display/StatCard/StatCard.test.stories.tsx +0 -240
- package/src/components/data-display/Stepper/Stepper.stories.tsx +0 -540
- package/src/components/data-display/Stepper/Stepper.test.stories.tsx +0 -600
- package/src/components/data-display/Table/Table.stories.tsx +0 -803
- package/src/components/data-display/Table/Table.test.stories.tsx +0 -369
- package/src/components/data-display/Timeline/Timeline.stories.tsx +0 -442
- package/src/components/data-display/Timeline/Timeline.test.stories.tsx +0 -930
- package/src/components/data-display/TimingDiagram/TimingDiagram.stories.tsx +0 -475
- package/src/components/data-display/TimingDiagram/TimingDiagram.test.stories.tsx +0 -734
- package/src/components/data-display/Tooltip/Tooltip.stories.tsx +0 -468
- package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +0 -1154
- package/src/components/feedback/ConfirmAction/ConfirmAction.stories.tsx +0 -146
- package/src/components/feedback/ConfirmAction/ConfirmAction.test.stories.tsx +0 -114
- package/src/components/feedback/ConfirmAction/__tests__/confirm-action.test.tsx +0 -288
- package/src/components/feedback/Dialog/Dialog.stories.tsx +0 -833
- package/src/components/feedback/Dialog/Dialog.test.stories.tsx +0 -964
- package/src/components/feedback/Dialog/__tests__/dialog-content-spacing.test.tsx +0 -66
- package/src/components/feedback/Modal/Modal.stories.tsx +0 -765
- package/src/components/feedback/Modal/Modal.test.stories.tsx +0 -251
- package/src/components/feedback/Sonner/Sonner.stories.tsx +0 -698
- package/src/components/feedback/Sonner/Sonner.test.stories.tsx +0 -896
- package/src/components/feedback/StackedModal/StackedModal.stories.tsx +0 -1783
- package/src/components/feedback/StackedModal/StackedModal.test.stories.tsx +0 -973
- package/src/components/feedback/StackedModal/__tests__/stacked-modal-viewport.test.tsx +0 -104
- package/src/components/feedback/Toast/Toast.stories.tsx +0 -548
- package/src/components/feedback/Toast/Toast.test.stories.tsx +0 -834
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.stories.tsx +0 -691
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +0 -634
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +0 -665
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +0 -727
- package/src/components/form/Autocomplete/Autocomplete.stories.tsx +0 -715
- package/src/components/form/Autocomplete/Autocomplete.test.stories.tsx +0 -825
- package/src/components/form/Button/Button.stories.tsx +0 -365
- package/src/components/form/Button/Button.test.stories.tsx +0 -607
- package/src/components/form/Calendar/Calendar.stories.tsx +0 -349
- package/src/components/form/Calendar/Calendar.test.stories.tsx +0 -464
- package/src/components/form/CepField/CepField.stories.tsx +0 -138
- package/src/components/form/CepField/CepField.test.stories.tsx +0 -281
- package/src/components/form/Checkbox/Checkbox.stories.tsx +0 -265
- package/src/components/form/Checkbox/Checkbox.test.stories.tsx +0 -181
- package/src/components/form/CodeEditor/CodeEditor.stories.tsx +0 -871
- package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +0 -574
- package/src/components/form/Command/Command.stories.tsx +0 -580
- package/src/components/form/Command/Command.test.stories.tsx +0 -215
- package/src/components/form/CreatableSelect/CreatableSelect.stories.tsx +0 -112
- package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +0 -134
- package/src/components/form/Form/Form.stories.tsx +0 -687
- package/src/components/form/Form/Form.test.stories.tsx +0 -601
- package/src/components/form/Input/Input.stories.tsx +0 -260
- package/src/components/form/Input/Input.test.stories.tsx +0 -1191
- package/src/components/form/InputOTP/InputOTP.stories.tsx +0 -774
- package/src/components/form/InputOTP/InputOTP.test.stories.tsx +0 -588
- package/src/components/form/Label/Label.stories.tsx +0 -473
- package/src/components/form/Label/Label.test.stories.tsx +0 -915
- package/src/components/form/Menubar/Menubar.stories.tsx +0 -472
- package/src/components/form/Menubar/Menubar.test.stories.tsx +0 -584
- package/src/components/form/PasswordStrength/PasswordStrength.stories.tsx +0 -562
- package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +0 -327
- package/src/components/form/PhoneInput/PhoneInput.stories.tsx +0 -495
- package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +0 -666
- package/src/components/form/RadioGroup/RadioGroup.stories.tsx +0 -518
- package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +0 -685
- package/src/components/form/RichTextEditor/RichTextEditor.stories.tsx +0 -261
- package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +0 -491
- package/src/components/form/SearchPalette/SearchPalette.stories.tsx +0 -135
- package/src/components/form/Select/Select.stories.tsx +0 -364
- package/src/components/form/Select/Select.test.stories.tsx +0 -985
- package/src/components/form/Slider/Slider.stories.tsx +0 -418
- package/src/components/form/Slider/Slider.test.stories.tsx +0 -1042
- package/src/components/form/Switch/Switch.stories.tsx +0 -697
- package/src/components/form/Switch/Switch.test.stories.tsx +0 -597
- package/src/components/form/Textarea/Textarea.stories.tsx +0 -473
- package/src/components/form/Textarea/Textarea.test.stories.tsx +0 -702
- package/src/components/form/Toggle/Toggle.stories.tsx +0 -638
- package/src/components/form/Toggle/Toggle.test.stories.tsx +0 -1159
- package/src/components/form/ToggleGroup/ToggleGroup.stories.tsx +0 -617
- package/src/components/form/ToggleGroup/ToggleGroup.test.stories.tsx +0 -915
- package/src/components/form/UploadButton/UploadButton.stories.tsx +0 -367
- package/src/components/form/UploadButton/UploadButton.test.stories.tsx +0 -573
- package/src/components/form/total-form/total-form.test.tsx +0 -214
- package/src/components/layout/Accordion/Accordion.stories.tsx +0 -694
- package/src/components/layout/Accordion/Accordion.test.stories.tsx +0 -1344
- package/src/components/layout/Card/Card.stories.tsx +0 -591
- package/src/components/layout/Card/Card.test.stories.tsx +0 -1134
- package/src/components/layout/CardGrid/__tests__/CardGrid.test.tsx +0 -92
- package/src/components/layout/Collapsible/Collapsible.stories.tsx +0 -180
- package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +0 -308
- package/src/components/layout/Container/Container.stories.tsx +0 -557
- package/src/components/layout/Container/Container.test.stories.tsx +0 -745
- package/src/components/layout/ContentToolbar/ContentToolbar.stories.tsx +0 -129
- package/src/components/layout/ContentToolbar/ContentToolbar.test.stories.tsx +0 -251
- package/src/components/layout/ContentToolbar/__tests__/ColumnsMenu.test.tsx +0 -39
- package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +0 -131
- package/src/components/layout/ContentToolbar/__tests__/SavedViewsMenu.test.tsx +0 -99
- package/src/components/layout/Dashboard/Dashboard.stories.tsx +0 -104
- package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +0 -190
- package/src/components/layout/Drawer/Drawer.stories.tsx +0 -658
- package/src/components/layout/Drawer/Drawer.test.stories.tsx +0 -1343
- package/src/components/layout/Resizable/Resizable.stories.tsx +0 -1039
- package/src/components/layout/Resizable/Resizable.test.stories.tsx +0 -754
- package/src/components/layout/ScrollArea/ScrollArea.stories.tsx +0 -651
- package/src/components/layout/ScrollArea/ScrollArea.test.stories.tsx +0 -619
- package/src/components/layout/Separator/Separator.stories.tsx +0 -563
- package/src/components/layout/Separator/Separator.test.stories.tsx +0 -518
- package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +0 -192
- package/src/components/layout/SettingsLayout/SettingsLayout.test.stories.tsx +0 -175
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -609
- package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +0 -1324
- package/src/components/layout/Skeleton/Skeleton.stories.tsx +0 -689
- package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +0 -521
- package/src/components/layout/Spacer/Spacer.stories.tsx +0 -502
- package/src/components/layout/Spacer/Spacer.test.stories.tsx +0 -474
- package/src/components/layout/TableFilter/TableFilter.stories.tsx +0 -82
- package/src/components/layout/TableFilter/TableFilter.test.stories.tsx +0 -87
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +0 -638
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +0 -1008
- package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +0 -386
- package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +0 -435
- package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +0 -614
- package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +0 -845
- package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +0 -578
- package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +0 -660
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +0 -516
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +0 -935
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +0 -501
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +0 -453
- package/src/components/navigation/Pagination/Pagination.stories.tsx +0 -602
- package/src/components/navigation/Pagination/Pagination.test.stories.tsx +0 -520
- package/src/components/navigation/Tabs/Tabs.stories.tsx +0 -1004
- package/src/components/navigation/Tabs/Tabs.test.stories.tsx +0 -1225
- package/src/components/typography/Blockquote/Blockquote.stories.tsx +0 -359
- package/src/components/typography/Blockquote/Blockquote.test.stories.tsx +0 -432
- package/src/components/typography/Code/Code.stories.tsx +0 -686
- package/src/components/typography/Code/Code.test.stories.tsx +0 -703
- package/src/components/typography/Heading/Heading.stories.tsx +0 -451
- package/src/components/typography/Heading/Heading.test.stories.tsx +0 -830
- package/src/components/typography/Paragraph/Paragraph.stories.tsx +0 -280
- package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +0 -231
- package/src/components/typography/Text/Text.stories.tsx +0 -359
- package/src/components/typography/Text/Text.test.stories.tsx +0 -759
- package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +0 -945
- package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +0 -603
- package/src/components/utility/AspectRatio/AspectRatio.stories.tsx +0 -414
- package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +0 -859
- package/src/components/utility/InfiniteScroll/InfiniteScroll.stories.tsx +0 -620
- package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +0 -361
- package/src/components/utility/InstallPrompt/InstallPrompt.stories.tsx +0 -118
- package/src/components/utility/InstallPrompt/InstallPrompt.test.stories.tsx +0 -83
- package/src/components/utility/InstallPrompt/__tests__/InstallPrompt.ios.test.tsx +0 -65
- package/src/components/utility/InstallPrompt/__tests__/usePwaInstall.test.tsx +0 -271
- package/src/components/utility/Portal/Portal.stories.tsx +0 -340
- package/src/components/utility/Portal/Portal.test.stories.tsx +0 -2086
- package/src/components/utility/Transition/Transition.stories.tsx +0 -493
- package/src/components/utility/Transition/Transition.test.stories.tsx +0 -854
- package/src/components/utility/VirtualList/VirtualList.stories.tsx +0 -1073
- package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +0 -1085
- package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +0 -431
- package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +0 -364
- /package/src/{button.tsx → button/button.tsx} +0 -0
|
@@ -1,603 +0,0 @@
|
|
|
1
|
-
import Favorite from '@mui/icons-material/Favorite';
|
|
2
|
-
import Refresh from '@mui/icons-material/Refresh';
|
|
3
|
-
import Settings from '@mui/icons-material/Settings';
|
|
4
|
-
import Star from '@mui/icons-material/Star';
|
|
5
|
-
import { Box, Stack, Typography } from '@mui/material';
|
|
6
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { expect, fn,userEvent, waitFor, within } from 'storybook/test';
|
|
9
|
-
|
|
10
|
-
import { AnimatedIcon } from './AnimatedIcon';
|
|
11
|
-
|
|
12
|
-
const meta: Meta<typeof AnimatedIcon> = {
|
|
13
|
-
title: 'Enhanced/AnimatedIcon/Tests',
|
|
14
|
-
component: AnimatedIcon,
|
|
15
|
-
parameters: {
|
|
16
|
-
layout: 'centered',
|
|
17
|
-
chromatic: { disableSnapshot: false },
|
|
18
|
-
},
|
|
19
|
-
tags: ['autodocs', 'test'],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
export type Story = StoryObj<typeof meta>;
|
|
24
|
-
|
|
25
|
-
// Basic Interaction Tests
|
|
26
|
-
export const BasicInteraction: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
children: <Settings />,
|
|
29
|
-
variant: 'rotate',
|
|
30
|
-
size: 'md',
|
|
31
|
-
onClick: fn(),
|
|
32
|
-
dataTestId: 'animated-icon-basic',
|
|
33
|
-
},
|
|
34
|
-
play: async ({ args, canvasElement }) => {
|
|
35
|
-
const canvas = within(canvasElement);
|
|
36
|
-
const animatedIcon = canvas.getByRole('img');
|
|
37
|
-
|
|
38
|
-
// Test that component renders
|
|
39
|
-
await expect(animatedIcon).toBeInTheDocument();
|
|
40
|
-
|
|
41
|
-
// Test data-testid attribute
|
|
42
|
-
await expect(animatedIcon).toHaveAttribute('data-testid', 'animated-icon-basic');
|
|
43
|
-
const iconByTestId = canvas.getByTestId('animated-icon-basic');
|
|
44
|
-
await expect(iconByTestId).toBeInTheDocument();
|
|
45
|
-
|
|
46
|
-
// Test click functionality
|
|
47
|
-
await userEvent.click(animatedIcon);
|
|
48
|
-
await expect(args.onClick).toHaveBeenCalledTimes(1);
|
|
49
|
-
|
|
50
|
-
// Test aria-label
|
|
51
|
-
await expect(animatedIcon).toHaveAttribute('aria-label');
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// Form Interaction Tests
|
|
56
|
-
const FormInteractionComponent = () => {
|
|
57
|
-
const [selectedIcon, setSelectedIcon] = React.useState<string>('settings');
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<Stack spacing={3} alignItems="center">
|
|
61
|
-
<Typography variant="h6">Select an Icon</Typography>
|
|
62
|
-
<Stack direction="row" spacing={3}>
|
|
63
|
-
{[
|
|
64
|
-
{ key: 'settings', icon: <Settings />, label: 'Settings' },
|
|
65
|
-
{ key: 'favorite', icon: <Favorite />, label: 'Favorite' },
|
|
66
|
-
{ key: 'star', icon: <Star />, label: 'Star' },
|
|
67
|
-
].map(({ key, icon, label }) => (
|
|
68
|
-
<AnimatedIcon
|
|
69
|
-
key={key}
|
|
70
|
-
variant={selectedIcon === key ? 'pulse' : 'none'}
|
|
71
|
-
size="lg"
|
|
72
|
-
color={selectedIcon === key ? '#FF6B6B' : undefined}
|
|
73
|
-
glow={selectedIcon === key}
|
|
74
|
-
onClick={() => setSelectedIcon(key)}
|
|
75
|
-
aria-label={`Select ${label} icon`}
|
|
76
|
-
dataTestId={`animated-icon-${key}`}
|
|
77
|
-
>
|
|
78
|
-
{icon}
|
|
79
|
-
</AnimatedIcon>
|
|
80
|
-
))}
|
|
81
|
-
</Stack>
|
|
82
|
-
<Typography variant="body2" data-testid="selected-icon">
|
|
83
|
-
Selected: {selectedIcon}
|
|
84
|
-
</Typography>
|
|
85
|
-
</Stack>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const FormInteraction: Story = {
|
|
90
|
-
render: () => <FormInteractionComponent />,
|
|
91
|
-
play: async ({ canvasElement }) => {
|
|
92
|
-
const canvas = within(canvasElement);
|
|
93
|
-
|
|
94
|
-
// Test initial state
|
|
95
|
-
const selectedText = canvas.getByTestId('selected-icon');
|
|
96
|
-
await expect(selectedText).toHaveTextContent('Selected: settings');
|
|
97
|
-
|
|
98
|
-
// Test that testIds are present
|
|
99
|
-
const settingsIcon = canvas.getByTestId('animated-icon-settings');
|
|
100
|
-
const favoriteIcon = canvas.getByTestId('animated-icon-favorite');
|
|
101
|
-
const starIcon = canvas.getByTestId('animated-icon-star');
|
|
102
|
-
await expect(settingsIcon).toBeInTheDocument();
|
|
103
|
-
await expect(favoriteIcon).toBeInTheDocument();
|
|
104
|
-
await expect(starIcon).toBeInTheDocument();
|
|
105
|
-
|
|
106
|
-
// Test clicking different icons using testId
|
|
107
|
-
await userEvent.click(favoriteIcon);
|
|
108
|
-
|
|
109
|
-
await waitFor(async () => {
|
|
110
|
-
await expect(selectedText).toHaveTextContent('Selected: favorite');
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// Test star icon using testId
|
|
114
|
-
await userEvent.click(starIcon);
|
|
115
|
-
|
|
116
|
-
await waitFor(async () => {
|
|
117
|
-
await expect(selectedText).toHaveTextContent('Selected: star');
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// Keyboard Navigation Tests
|
|
123
|
-
export const KeyboardNavigation: Story = {
|
|
124
|
-
render: () => (
|
|
125
|
-
<Stack spacing={3} alignItems="center">
|
|
126
|
-
<Typography variant="h6">Keyboard Navigation Test</Typography>
|
|
127
|
-
<Stack direction="row" spacing={3}>
|
|
128
|
-
<AnimatedIcon
|
|
129
|
-
variant="rotate"
|
|
130
|
-
size="md"
|
|
131
|
-
onClick={fn()}
|
|
132
|
-
aria-label="First animated icon"
|
|
133
|
-
tabIndex={0}
|
|
134
|
-
>
|
|
135
|
-
<Settings />
|
|
136
|
-
</AnimatedIcon>
|
|
137
|
-
<AnimatedIcon
|
|
138
|
-
variant="pulse"
|
|
139
|
-
size="md"
|
|
140
|
-
onClick={fn()}
|
|
141
|
-
aria-label="Second animated icon"
|
|
142
|
-
tabIndex={0}
|
|
143
|
-
>
|
|
144
|
-
<Favorite />
|
|
145
|
-
</AnimatedIcon>
|
|
146
|
-
<AnimatedIcon
|
|
147
|
-
variant="translate"
|
|
148
|
-
size="md"
|
|
149
|
-
onClick={fn()}
|
|
150
|
-
aria-label="Third animated icon"
|
|
151
|
-
tabIndex={0}
|
|
152
|
-
>
|
|
153
|
-
<Star />
|
|
154
|
-
</AnimatedIcon>
|
|
155
|
-
</Stack>
|
|
156
|
-
</Stack>
|
|
157
|
-
),
|
|
158
|
-
play: async ({ canvasElement }) => {
|
|
159
|
-
const canvas = within(canvasElement);
|
|
160
|
-
|
|
161
|
-
// Test tab navigation
|
|
162
|
-
const firstIcon = canvas.getByLabelText('First animated icon');
|
|
163
|
-
const secondIcon = canvas.getByLabelText('Second animated icon');
|
|
164
|
-
const thirdIcon = canvas.getByLabelText('Third animated icon');
|
|
165
|
-
|
|
166
|
-
// Tab to the first icon rather than focusing it directly, so the whole
|
|
167
|
-
// sequence below exercises one keyboard journey through the three icons.
|
|
168
|
-
await userEvent.tab();
|
|
169
|
-
await waitFor(() => expect(firstIcon).toHaveFocus());
|
|
170
|
-
|
|
171
|
-
// Tab to second icon
|
|
172
|
-
await userEvent.tab();
|
|
173
|
-
await waitFor(() => expect(secondIcon).toHaveFocus());
|
|
174
|
-
|
|
175
|
-
// Tab to third icon
|
|
176
|
-
await userEvent.tab();
|
|
177
|
-
await waitFor(() => expect(thirdIcon).toHaveFocus());
|
|
178
|
-
|
|
179
|
-
// Test Enter key activation
|
|
180
|
-
await userEvent.keyboard('{Enter}');
|
|
181
|
-
// Note: onClick would be called, but we can't test it directly in this context
|
|
182
|
-
},
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// Test ID Tests
|
|
186
|
-
export const TestIdVerification: Story = {
|
|
187
|
-
render: () => (
|
|
188
|
-
<Stack spacing={3} alignItems="center">
|
|
189
|
-
<Typography variant="h6">Test ID Verification</Typography>
|
|
190
|
-
<Stack direction="row" spacing={3}>
|
|
191
|
-
<AnimatedIcon
|
|
192
|
-
variant="rotate"
|
|
193
|
-
size="md"
|
|
194
|
-
dataTestId="icon-with-testid"
|
|
195
|
-
aria-label="Icon with test ID"
|
|
196
|
-
>
|
|
197
|
-
<Settings />
|
|
198
|
-
</AnimatedIcon>
|
|
199
|
-
<AnimatedIcon
|
|
200
|
-
variant="pulse"
|
|
201
|
-
size="md"
|
|
202
|
-
aria-label="Icon without test ID"
|
|
203
|
-
>
|
|
204
|
-
<Favorite />
|
|
205
|
-
</AnimatedIcon>
|
|
206
|
-
</Stack>
|
|
207
|
-
</Stack>
|
|
208
|
-
),
|
|
209
|
-
play: async ({ canvasElement }) => {
|
|
210
|
-
const canvas = within(canvasElement);
|
|
211
|
-
|
|
212
|
-
// Test that icon with testId can be queried
|
|
213
|
-
const iconWithTestId = canvas.getByTestId('icon-with-testid');
|
|
214
|
-
await expect(iconWithTestId).toBeInTheDocument();
|
|
215
|
-
await expect(iconWithTestId).toHaveAttribute('data-testid', 'icon-with-testid');
|
|
216
|
-
|
|
217
|
-
// Test that icon without testId doesn't have the attribute
|
|
218
|
-
const iconWithoutTestId = canvas.getByLabelText('Icon without test ID');
|
|
219
|
-
await expect(iconWithoutTestId).toBeInTheDocument();
|
|
220
|
-
await expect(iconWithoutTestId).not.toHaveAttribute('data-testid');
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
// Screen Reader Tests
|
|
225
|
-
export const ScreenReader: Story = {
|
|
226
|
-
args: {
|
|
227
|
-
children: <Refresh />,
|
|
228
|
-
variant: 'rotate',
|
|
229
|
-
size: 'lg',
|
|
230
|
-
'aria-label': 'Loading animation icon',
|
|
231
|
-
},
|
|
232
|
-
play: async ({ canvasElement }) => {
|
|
233
|
-
const canvas = within(canvasElement);
|
|
234
|
-
const icon = canvas.getByRole('img');
|
|
235
|
-
|
|
236
|
-
// Test that proper ARIA attributes are present
|
|
237
|
-
await expect(icon).toHaveAttribute('role', 'img');
|
|
238
|
-
await expect(icon).toHaveAttribute('aria-label', 'Loading animation icon');
|
|
239
|
-
|
|
240
|
-
// Test that the icon is accessible to screen readers
|
|
241
|
-
const description = canvas.getByLabelText('Loading animation icon');
|
|
242
|
-
await expect(description).toBeInTheDocument();
|
|
243
|
-
},
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
// Focus Management Tests
|
|
247
|
-
const FocusManagementComponent = () => {
|
|
248
|
-
const [focusedIndex, setFocusedIndex] = React.useState<number | null>(null);
|
|
249
|
-
|
|
250
|
-
return (
|
|
251
|
-
<Stack spacing={3} alignItems="center">
|
|
252
|
-
<Typography variant="h6">Focus Management</Typography>
|
|
253
|
-
<Stack direction="row" spacing={3}>
|
|
254
|
-
{[0, 1, 2].map((index) => (
|
|
255
|
-
<AnimatedIcon
|
|
256
|
-
key={index}
|
|
257
|
-
variant={focusedIndex === index ? 'pulse' : 'none'}
|
|
258
|
-
size="lg"
|
|
259
|
-
glow={focusedIndex === index}
|
|
260
|
-
onFocus={() => setFocusedIndex(index)}
|
|
261
|
-
onBlur={() => setFocusedIndex(null)}
|
|
262
|
-
tabIndex={0}
|
|
263
|
-
aria-label={`Focus test icon ${index + 1}`}
|
|
264
|
-
>
|
|
265
|
-
<Settings />
|
|
266
|
-
</AnimatedIcon>
|
|
267
|
-
))}
|
|
268
|
-
</Stack>
|
|
269
|
-
</Stack>
|
|
270
|
-
);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
export const FocusManagement: Story = {
|
|
274
|
-
render: () => <FocusManagementComponent />,
|
|
275
|
-
play: async ({ canvasElement }) => {
|
|
276
|
-
const canvas = within(canvasElement);
|
|
277
|
-
|
|
278
|
-
// Test focus events
|
|
279
|
-
const firstIcon = canvas.getByLabelText('Focus test icon 1');
|
|
280
|
-
const secondIcon = canvas.getByLabelText('Focus test icon 2');
|
|
281
|
-
|
|
282
|
-
// Focus first icon
|
|
283
|
-
await userEvent.tab();
|
|
284
|
-
await waitFor(() => expect(firstIcon).toHaveFocus());
|
|
285
|
-
|
|
286
|
-
// Move focus to second icon — asserted together so the hand-off is checked
|
|
287
|
-
// as one state, not as two reads that could straddle a re-render.
|
|
288
|
-
await userEvent.tab();
|
|
289
|
-
await waitFor(() => {
|
|
290
|
-
expect(secondIcon).toHaveFocus();
|
|
291
|
-
expect(firstIcon).not.toHaveFocus();
|
|
292
|
-
});
|
|
293
|
-
},
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
// Responsive Design Tests
|
|
297
|
-
export const ResponsiveDesign: Story = {
|
|
298
|
-
render: () => (
|
|
299
|
-
<Stack spacing={3}>
|
|
300
|
-
<Typography variant="h6">Responsive Sizes</Typography>
|
|
301
|
-
<Stack direction="row" spacing={3} flexWrap="wrap">
|
|
302
|
-
{(['sm', 'md', 'lg', 'xl'] as const).map((size) => (
|
|
303
|
-
<Box key={size} textAlign="center">
|
|
304
|
-
<AnimatedIcon variant="pulse" size={size}>
|
|
305
|
-
<Star />
|
|
306
|
-
</AnimatedIcon>
|
|
307
|
-
<Typography variant="caption" display="block" mt={1}>
|
|
308
|
-
{size.toUpperCase()}
|
|
309
|
-
</Typography>
|
|
310
|
-
</Box>
|
|
311
|
-
))}
|
|
312
|
-
</Stack>
|
|
313
|
-
</Stack>
|
|
314
|
-
),
|
|
315
|
-
play: async ({ canvasElement }) => {
|
|
316
|
-
const canvas = within(canvasElement);
|
|
317
|
-
|
|
318
|
-
// Test that all size variants render
|
|
319
|
-
const sizes = ['SM', 'MD', 'LG', 'XL'];
|
|
320
|
-
for (const size of sizes) {
|
|
321
|
-
const sizeLabel = canvas.getByText(size);
|
|
322
|
-
await expect(sizeLabel).toBeInTheDocument();
|
|
323
|
-
}
|
|
324
|
-
},
|
|
325
|
-
parameters: {
|
|
326
|
-
viewport: {
|
|
327
|
-
viewports: {
|
|
328
|
-
mobile: { name: 'Mobile', styles: { width: '375px', height: '667px' } },
|
|
329
|
-
tablet: { name: 'Tablet', styles: { width: '768px', height: '1024px' } },
|
|
330
|
-
desktop: { name: 'Desktop', styles: { width: '1200px', height: '800px' } },
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
// Theme Variation Tests
|
|
337
|
-
export const ThemeVariations: Story = {
|
|
338
|
-
render: () => (
|
|
339
|
-
<Stack spacing={3}>
|
|
340
|
-
<Typography variant="h6">Theme Variations</Typography>
|
|
341
|
-
<Stack direction="row" spacing={3}>
|
|
342
|
-
<Box sx={{ p: 2, bgcolor: 'background.paper', borderRadius: 1 }}>
|
|
343
|
-
<AnimatedIcon variant="rotate" size="lg">
|
|
344
|
-
<Settings />
|
|
345
|
-
</AnimatedIcon>
|
|
346
|
-
</Box>
|
|
347
|
-
<Box sx={{ p: 2, bgcolor: 'primary.main', borderRadius: 1 }}>
|
|
348
|
-
<AnimatedIcon variant="pulse" size="lg" color="#ffffff">
|
|
349
|
-
<Favorite />
|
|
350
|
-
</AnimatedIcon>
|
|
351
|
-
</Box>
|
|
352
|
-
<Box sx={{ p: 2, bgcolor: 'secondary.main', borderRadius: 1 }}>
|
|
353
|
-
<AnimatedIcon variant="translate" size="lg" color="#ffffff">
|
|
354
|
-
<Star />
|
|
355
|
-
</AnimatedIcon>
|
|
356
|
-
</Box>
|
|
357
|
-
</Stack>
|
|
358
|
-
</Stack>
|
|
359
|
-
),
|
|
360
|
-
play: async ({ canvasElement }) => {
|
|
361
|
-
const canvas = within(canvasElement);
|
|
362
|
-
const icons = canvas.getAllByRole('img');
|
|
363
|
-
|
|
364
|
-
// Test that all theme variations render
|
|
365
|
-
await expect(icons).toHaveLength(3);
|
|
366
|
-
|
|
367
|
-
// Test that icons are properly themed
|
|
368
|
-
for (const icon of icons) {
|
|
369
|
-
await expect(icon).toBeVisible();
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
// Visual States Tests
|
|
375
|
-
export const VisualStates: Story = {
|
|
376
|
-
render: () => (
|
|
377
|
-
<Stack spacing={4}>
|
|
378
|
-
<Typography variant="h6">Visual Animation States</Typography>
|
|
379
|
-
<Stack spacing={3}>
|
|
380
|
-
<Box>
|
|
381
|
-
<Typography variant="subtitle2" gutterBottom>
|
|
382
|
-
Animation Variants
|
|
383
|
-
</Typography>
|
|
384
|
-
<Stack direction="row" spacing={3}>
|
|
385
|
-
<AnimatedIcon variant="rotate" size="lg" aria-label="Rotating icon">
|
|
386
|
-
<Refresh />
|
|
387
|
-
</AnimatedIcon>
|
|
388
|
-
<AnimatedIcon variant="pulse" size="lg" aria-label="Pulsing icon">
|
|
389
|
-
<Favorite />
|
|
390
|
-
</AnimatedIcon>
|
|
391
|
-
<AnimatedIcon variant="translate" size="lg" aria-label="Translating icon">
|
|
392
|
-
<Star />
|
|
393
|
-
</AnimatedIcon>
|
|
394
|
-
<AnimatedIcon variant="none" size="lg" aria-label="Static icon">
|
|
395
|
-
<Settings />
|
|
396
|
-
</AnimatedIcon>
|
|
397
|
-
</Stack>
|
|
398
|
-
</Box>
|
|
399
|
-
|
|
400
|
-
<Box>
|
|
401
|
-
<Typography variant="subtitle2" gutterBottom>
|
|
402
|
-
Effects
|
|
403
|
-
</Typography>
|
|
404
|
-
<Stack direction="row" spacing={3}>
|
|
405
|
-
<AnimatedIcon variant="pulse" size="lg" glow aria-label="Glowing icon">
|
|
406
|
-
<Star />
|
|
407
|
-
</AnimatedIcon>
|
|
408
|
-
<AnimatedIcon variant="rotate" size="lg" glass aria-label="Glass effect icon">
|
|
409
|
-
<Settings />
|
|
410
|
-
</AnimatedIcon>
|
|
411
|
-
</Stack>
|
|
412
|
-
</Box>
|
|
413
|
-
</Stack>
|
|
414
|
-
</Stack>
|
|
415
|
-
),
|
|
416
|
-
play: async ({ canvasElement }) => {
|
|
417
|
-
const canvas = within(canvasElement);
|
|
418
|
-
|
|
419
|
-
// Test that all visual states render
|
|
420
|
-
const rotatingIcon = canvas.getByLabelText('Rotating icon');
|
|
421
|
-
const pulsingIcon = canvas.getByLabelText('Pulsing icon');
|
|
422
|
-
const translatingIcon = canvas.getByLabelText('Translating icon');
|
|
423
|
-
const staticIcon = canvas.getByLabelText('Static icon');
|
|
424
|
-
const glowingIcon = canvas.getByLabelText('Glowing icon');
|
|
425
|
-
const glassIcon = canvas.getByLabelText('Glass effect icon');
|
|
426
|
-
|
|
427
|
-
await expect(rotatingIcon).toBeVisible();
|
|
428
|
-
await expect(pulsingIcon).toBeVisible();
|
|
429
|
-
await expect(translatingIcon).toBeVisible();
|
|
430
|
-
await expect(staticIcon).toBeVisible();
|
|
431
|
-
await expect(glowingIcon).toBeVisible();
|
|
432
|
-
await expect(glassIcon).toBeVisible();
|
|
433
|
-
},
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
// Performance Tests
|
|
437
|
-
export const Performance: Story = {
|
|
438
|
-
render: () => {
|
|
439
|
-
const icons = Array.from({ length: 20 }, (_, i) => (
|
|
440
|
-
<AnimatedIcon
|
|
441
|
-
key={i}
|
|
442
|
-
variant={(['rotate', 'pulse', 'translate'] as const)[i % 3]}
|
|
443
|
-
size="md"
|
|
444
|
-
duration={1 + (i % 3)}
|
|
445
|
-
>
|
|
446
|
-
<Settings />
|
|
447
|
-
</AnimatedIcon>
|
|
448
|
-
));
|
|
449
|
-
|
|
450
|
-
return (
|
|
451
|
-
<Stack spacing={3}>
|
|
452
|
-
<Typography variant="h6">Performance Test - 20 Animated Icons</Typography>
|
|
453
|
-
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 2 }}>{icons}</Box>
|
|
454
|
-
</Stack>
|
|
455
|
-
);
|
|
456
|
-
},
|
|
457
|
-
play: async ({ canvasElement }) => {
|
|
458
|
-
const canvas = within(canvasElement);
|
|
459
|
-
const icons = canvas.getAllByRole('img');
|
|
460
|
-
|
|
461
|
-
// Test that all icons render without performance issues
|
|
462
|
-
await expect(icons).toHaveLength(20);
|
|
463
|
-
|
|
464
|
-
// Test that animations are working
|
|
465
|
-
for (const icon of icons.slice(0, 5)) {
|
|
466
|
-
// Test first 5 to avoid timeout
|
|
467
|
-
await expect(icon).toBeVisible();
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
// Edge Cases Tests
|
|
473
|
-
export const EdgeCases: Story = {
|
|
474
|
-
render: () => (
|
|
475
|
-
<Stack spacing={4}>
|
|
476
|
-
<Typography variant="h6">Edge Cases</Typography>
|
|
477
|
-
|
|
478
|
-
<Box>
|
|
479
|
-
<Typography variant="subtitle2" gutterBottom>
|
|
480
|
-
No Children
|
|
481
|
-
</Typography>
|
|
482
|
-
<AnimatedIcon variant="pulse" size="md" aria-label="Empty icon">
|
|
483
|
-
{null}
|
|
484
|
-
</AnimatedIcon>
|
|
485
|
-
</Box>
|
|
486
|
-
|
|
487
|
-
<Box>
|
|
488
|
-
<Typography variant="subtitle2" gutterBottom>
|
|
489
|
-
Very Long Duration
|
|
490
|
-
</Typography>
|
|
491
|
-
<AnimatedIcon variant="rotate" size="md" duration={10}>
|
|
492
|
-
<Settings />
|
|
493
|
-
</AnimatedIcon>
|
|
494
|
-
</Box>
|
|
495
|
-
|
|
496
|
-
<Box>
|
|
497
|
-
<Typography variant="subtitle2" gutterBottom>
|
|
498
|
-
Very Short Duration
|
|
499
|
-
</Typography>
|
|
500
|
-
<AnimatedIcon variant="pulse" size="md" duration={0.1}>
|
|
501
|
-
<Favorite />
|
|
502
|
-
</AnimatedIcon>
|
|
503
|
-
</Box>
|
|
504
|
-
|
|
505
|
-
<Box>
|
|
506
|
-
<Typography variant="subtitle2" gutterBottom>
|
|
507
|
-
With Delay
|
|
508
|
-
</Typography>
|
|
509
|
-
<AnimatedIcon variant="translate" size="md" delay={2}>
|
|
510
|
-
<Star />
|
|
511
|
-
</AnimatedIcon>
|
|
512
|
-
</Box>
|
|
513
|
-
|
|
514
|
-
<Box>
|
|
515
|
-
<Typography variant="subtitle2" gutterBottom>
|
|
516
|
-
Non-looping Animation
|
|
517
|
-
</Typography>
|
|
518
|
-
<AnimatedIcon variant="pulse" size="md" loop={false}>
|
|
519
|
-
<Settings />
|
|
520
|
-
</AnimatedIcon>
|
|
521
|
-
</Box>
|
|
522
|
-
</Stack>
|
|
523
|
-
),
|
|
524
|
-
play: async ({ canvasElement }) => {
|
|
525
|
-
const canvas = within(canvasElement);
|
|
526
|
-
|
|
527
|
-
// Test that edge cases don't break the component
|
|
528
|
-
const emptyIcon = canvas.getByLabelText('Empty icon');
|
|
529
|
-
await expect(emptyIcon).toBeInTheDocument();
|
|
530
|
-
|
|
531
|
-
// Test that all animations render
|
|
532
|
-
const icons = canvas.getAllByRole('img');
|
|
533
|
-
await expect(icons.length).toBeGreaterThan(0);
|
|
534
|
-
|
|
535
|
-
for (const icon of icons) {
|
|
536
|
-
await expect(icon).toBeVisible();
|
|
537
|
-
}
|
|
538
|
-
},
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
// Integration Tests
|
|
542
|
-
export const Integration: Story = {
|
|
543
|
-
render: () => (
|
|
544
|
-
<Stack spacing={3}>
|
|
545
|
-
<Typography variant="h6">Integration with Other Components</Typography>
|
|
546
|
-
|
|
547
|
-
{/* Integration with Button-like behavior */}
|
|
548
|
-
<Box sx={{ p: 2, border: '1px solid', borderColor: 'divider', borderRadius: 1 }}>
|
|
549
|
-
<Stack direction="row" spacing={2} alignItems="center">
|
|
550
|
-
<AnimatedIcon variant="rotate" size="sm">
|
|
551
|
-
<Refresh />
|
|
552
|
-
</AnimatedIcon>
|
|
553
|
-
<Typography>Refreshing data...</Typography>
|
|
554
|
-
</Stack>
|
|
555
|
-
</Box>
|
|
556
|
-
|
|
557
|
-
{/* Integration with form-like behavior */}
|
|
558
|
-
<Box sx={{ p: 2, bgcolor: 'background.paper', borderRadius: 1 }}>
|
|
559
|
-
<Stack direction="row" spacing={2} alignItems="center">
|
|
560
|
-
<AnimatedIcon variant="pulse" size="md" glow glowColor="#4CAF50">
|
|
561
|
-
<Favorite />
|
|
562
|
-
</AnimatedIcon>
|
|
563
|
-
<Typography>Like this content</Typography>
|
|
564
|
-
</Stack>
|
|
565
|
-
</Box>
|
|
566
|
-
|
|
567
|
-
{/* Integration with complex layouts */}
|
|
568
|
-
<Box sx={{ p: 3, background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)' }}>
|
|
569
|
-
<Stack direction="row" spacing={3} alignItems="center">
|
|
570
|
-
<AnimatedIcon variant="translate" size="lg" glass color="#ffffff">
|
|
571
|
-
<Star />
|
|
572
|
-
</AnimatedIcon>
|
|
573
|
-
<Box>
|
|
574
|
-
<Typography variant="h6" sx={{ color: 'common.white' }}>
|
|
575
|
-
Premium Feature
|
|
576
|
-
</Typography>
|
|
577
|
-
<Typography variant="body2" sx={{ color: 'rgba(255,255,255,0.8)' }}>
|
|
578
|
-
Enhanced with glass morphism
|
|
579
|
-
</Typography>
|
|
580
|
-
</Box>
|
|
581
|
-
</Stack>
|
|
582
|
-
</Box>
|
|
583
|
-
</Stack>
|
|
584
|
-
),
|
|
585
|
-
play: async ({ canvasElement }) => {
|
|
586
|
-
const canvas = within(canvasElement);
|
|
587
|
-
|
|
588
|
-
// Test integration scenarios
|
|
589
|
-
const refreshText = canvas.getByText('Refreshing data...');
|
|
590
|
-
const likeText = canvas.getByText('Like this content');
|
|
591
|
-
const premiumText = canvas.getByText('Premium Feature');
|
|
592
|
-
|
|
593
|
-
await expect(refreshText).toBeInTheDocument();
|
|
594
|
-
await expect(likeText).toBeInTheDocument();
|
|
595
|
-
await expect(premiumText).toBeInTheDocument();
|
|
596
|
-
|
|
597
|
-
// Test that icons are still functional in integrated contexts
|
|
598
|
-
const icons = canvas.getAllByRole('img');
|
|
599
|
-
for (const icon of icons) {
|
|
600
|
-
await expect(icon).toBeVisible();
|
|
601
|
-
}
|
|
602
|
-
},
|
|
603
|
-
};
|