@startsimpli/ui 0.4.7 → 0.4.8
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 +1 -1
- package/src/__mocks__/next/link.js +11 -0
- package/src/components/account/__tests__/account.test.tsx +315 -0
- package/src/components/command-palette/CommandGroup.tsx +23 -0
- package/src/components/command-palette/CommandPalette.tsx +183 -200
- package/src/components/command-palette/CommandResultItem.tsx +59 -0
- package/src/components/command-palette/__tests__/CommandGroup.test.tsx +81 -0
- package/src/components/command-palette/__tests__/CommandResultItem.test.tsx +166 -0
- package/src/components/command-palette/__tests__/command-palette-context.test.tsx +166 -0
- package/src/components/command-palette/__tests__/useCommandPaletteSearch.test.ts +271 -0
- package/src/components/command-palette/index.ts +6 -0
- package/src/components/command-palette/useCommandPaletteSearch.ts +114 -0
- package/src/components/compose/__tests__/compose.test.tsx +656 -0
- package/src/components/dashboard/PipelineFunnel.tsx +126 -0
- package/src/components/dashboard/TopCampaigns.tsx +132 -0
- package/src/components/dashboard/__tests__/dashboard.test.tsx +785 -0
- package/src/components/dashboard/index.ts +6 -0
- package/src/components/dialog/ConfirmDialog.tsx +72 -0
- package/src/components/dialog/__tests__/ConfirmDialog.test.tsx +126 -0
- package/src/components/dialog/index.ts +3 -0
- package/src/components/email-dialogs/__tests__/email-dialogs.test.tsx +982 -0
- package/src/components/email-editor/BlockRenderer.tsx +120 -0
- package/src/components/email-editor/__tests__/BlockRenderer.test.tsx +332 -0
- package/src/components/email-editor/__tests__/block-renderers.test.ts +624 -0
- package/src/components/email-editor/__tests__/email-html-renderer.test.ts +376 -0
- package/src/components/email-editor/blocks/__tests__/blocks.test.tsx +818 -0
- package/src/components/email-editor/editor-sidebar.tsx +6 -731
- package/src/components/email-editor/email-editor.tsx +78 -467
- package/src/components/email-editor/hooks/__tests__/useDragDrop.test.ts +355 -0
- package/src/components/email-editor/hooks/__tests__/useEmailEditorState.test.ts +551 -0
- package/src/components/email-editor/hooks/useDragDrop.ts +181 -0
- package/src/components/email-editor/hooks/useEmailEditorState.ts +426 -0
- package/src/components/email-editor/index.ts +1 -0
- package/src/components/email-editor/panels/BlockPropertyPanel.tsx +637 -0
- package/src/components/email-editor/panels/GlobalStylesPanel.tsx +108 -0
- package/src/components/email-editor/panels/SectionSettingsPanel.tsx +80 -0
- package/src/components/email-editor/panels/__tests__/BlockPropertyPanel.test.tsx +707 -0
- package/src/components/email-editor/panels/__tests__/GlobalStylesPanel.test.tsx +226 -0
- package/src/components/email-editor/panels/index.ts +3 -0
- package/src/components/enrichment/__tests__/enrichment.test.tsx +184 -0
- package/src/components/gantt/GanttBoardView.tsx +71 -0
- package/src/components/gantt/GanttChart.tsx +134 -881
- package/src/components/gantt/GanttFilterBar.tsx +100 -0
- package/src/components/gantt/GanttListView.tsx +63 -0
- package/src/components/gantt/GanttTimelineView.tsx +215 -0
- package/src/components/gantt/__tests__/GanttBoardView.test.tsx +305 -0
- package/src/components/gantt/__tests__/GanttFilterBar.test.tsx +544 -0
- package/src/components/gantt/__tests__/GanttListView.test.tsx +337 -0
- package/src/components/gantt/__tests__/GanttTimelineView.test.tsx +375 -0
- package/src/components/gantt/__tests__/gantt-utils.test.ts +341 -0
- package/src/components/gantt/__tests__/useGanttState.test.ts +535 -0
- package/src/components/gantt/hooks/useGanttState.ts +644 -0
- package/src/components/gantt/index.ts +10 -0
- package/src/components/integrations/__tests__/integrations.test.tsx +191 -0
- package/src/components/kanban/__tests__/kanban.test.tsx +157 -0
- package/src/components/lists/__tests__/lists.test.tsx +263 -0
- package/src/components/loading/__tests__/loading.test.tsx +114 -0
- package/src/components/navigation/__tests__/navigation.test.tsx +194 -0
- package/src/components/pipeline/__tests__/pipeline.test.tsx +169 -0
- package/src/components/settings/__tests__/settings.test.tsx +181 -0
- package/src/components/wizard/__tests__/wizard.test.tsx +97 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import { StepIndicator } from '../StepIndicator'
|
|
3
|
+
|
|
4
|
+
const steps = [
|
|
5
|
+
{ label: 'Account', description: 'Set up your account' },
|
|
6
|
+
{ label: 'Profile', description: 'Complete your profile' },
|
|
7
|
+
{ label: 'Review', description: 'Review and confirm' },
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
describe('StepIndicator', () => {
|
|
11
|
+
it('renders all step labels', () => {
|
|
12
|
+
render(<StepIndicator steps={steps} currentIndex={0} />)
|
|
13
|
+
expect(screen.getByText('Account')).toBeInTheDocument()
|
|
14
|
+
expect(screen.getByText('Profile')).toBeInTheDocument()
|
|
15
|
+
expect(screen.getByText('Review')).toBeInTheDocument()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('renders step numbers for non-completed steps', () => {
|
|
19
|
+
render(<StepIndicator steps={steps} currentIndex={0} />)
|
|
20
|
+
// Step 1 is active (no check icon), steps 2 and 3 are upcoming
|
|
21
|
+
expect(screen.getByText('2')).toBeInTheDocument()
|
|
22
|
+
expect(screen.getByText('3')).toBeInTheDocument()
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('renders as an ordered list', () => {
|
|
26
|
+
render(<StepIndicator steps={steps} currentIndex={0} />)
|
|
27
|
+
expect(screen.getByRole('list')).toBeInTheDocument()
|
|
28
|
+
expect(screen.getAllByRole('listitem')).toHaveLength(3)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('applies active styles to the current step label', () => {
|
|
32
|
+
render(<StepIndicator steps={steps} currentIndex={1} />)
|
|
33
|
+
const profileLabel = screen.getByText('Profile')
|
|
34
|
+
expect(profileLabel).toHaveClass('text-primary-600')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('applies completed styles to past step labels', () => {
|
|
38
|
+
render(<StepIndicator steps={steps} currentIndex={2} />)
|
|
39
|
+
const accountLabel = screen.getByText('Account')
|
|
40
|
+
expect(accountLabel).toHaveClass('text-gray-600')
|
|
41
|
+
const profileLabel = screen.getByText('Profile')
|
|
42
|
+
expect(profileLabel).toHaveClass('text-gray-600')
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it('applies upcoming styles to future step labels', () => {
|
|
46
|
+
render(<StepIndicator steps={steps} currentIndex={0} />)
|
|
47
|
+
const reviewLabel = screen.getByText('Review')
|
|
48
|
+
expect(reviewLabel).toHaveClass('text-gray-400')
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('does not render a connector after the last step', () => {
|
|
52
|
+
const { container } = render(<StepIndicator steps={steps} currentIndex={0} />)
|
|
53
|
+
// Connectors are h-0.5 divs between steps; should be n-1 = 2 connectors
|
|
54
|
+
const connectors = container.querySelectorAll('.h-0\\.5')
|
|
55
|
+
expect(connectors.length).toBe(steps.length - 1)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('completed step connectors have primary color', () => {
|
|
59
|
+
const { container } = render(<StepIndicator steps={steps} currentIndex={2} />)
|
|
60
|
+
const connectors = container.querySelectorAll('.h-0\\.5')
|
|
61
|
+
// Both connectors (between steps 1-2 and 2-3) should be completed
|
|
62
|
+
connectors.forEach((connector) => {
|
|
63
|
+
expect(connector).toHaveClass('bg-primary-600')
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('incomplete step connectors have gray color', () => {
|
|
68
|
+
const { container } = render(<StepIndicator steps={steps} currentIndex={0} />)
|
|
69
|
+
const connectors = container.querySelectorAll('.h-0\\.5')
|
|
70
|
+
connectors.forEach((connector) => {
|
|
71
|
+
expect(connector).toHaveClass('bg-gray-200')
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('applies custom className', () => {
|
|
76
|
+
const { container } = render(
|
|
77
|
+
<StepIndicator steps={steps} currentIndex={0} className="my-wizard" />
|
|
78
|
+
)
|
|
79
|
+
expect(container.firstChild).toHaveClass('my-wizard')
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('renders correctly with a single step', () => {
|
|
83
|
+
render(<StepIndicator steps={[{ label: 'Only Step' }]} currentIndex={0} />)
|
|
84
|
+
expect(screen.getByText('Only Step')).toBeInTheDocument()
|
|
85
|
+
// No connector for a single step
|
|
86
|
+
const { container } = render(
|
|
87
|
+
<StepIndicator steps={[{ label: 'Only Step' }]} currentIndex={0} />
|
|
88
|
+
)
|
|
89
|
+
expect(container.querySelectorAll('.h-0\\.5')).toHaveLength(0)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it('renders with currentIndex at last step', () => {
|
|
93
|
+
render(<StepIndicator steps={steps} currentIndex={2} />)
|
|
94
|
+
// "Review" should be active
|
|
95
|
+
expect(screen.getByText('Review')).toHaveClass('text-primary-600')
|
|
96
|
+
})
|
|
97
|
+
})
|