@nextsparkjs/theme-default 0.1.0-beta.44 → 0.1.0-beta.46
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/components/ai-chat/ChatPanel.tsx +7 -7
- package/components/ai-chat/Message.tsx +2 -2
- package/components/ai-chat/MessageInput.tsx +3 -3
- package/components/ai-chat/MessageList.tsx +3 -3
- package/components/ai-chat/TypingIndicator.tsx +2 -2
- package/entities/customers/api/docs.md +107 -0
- package/entities/customers/api/presets.ts +80 -0
- package/entities/pages/api/docs.md +114 -0
- package/entities/pages/api/presets.ts +72 -0
- package/entities/posts/api/docs.md +120 -0
- package/entities/posts/api/presets.ts +74 -0
- package/entities/tasks/api/docs.md +126 -0
- package/entities/tasks/api/presets.ts +84 -0
- package/lib/selectors.ts +2 -2
- package/messages/de/admin.json +45 -0
- package/messages/en/admin.json +45 -0
- package/messages/es/admin.json +45 -0
- package/messages/fr/admin.json +45 -0
- package/messages/it/admin.json +45 -0
- package/messages/pt/admin.json +45 -0
- package/package.json +3 -3
- package/styles/globals.css +24 -0
- package/tests/cypress/e2e/_utils/selectors/block-editor.bdd.md +491 -0
- package/tests/cypress/e2e/_utils/selectors/block-editor.cy.ts +475 -0
- package/tests/cypress/e2e/_utils/selectors/dashboard-container.cy.ts +52 -0
- package/tests/cypress/e2e/_utils/selectors/dashboard-mobile.cy.ts +14 -14
- package/tests/cypress/e2e/_utils/selectors/dashboard-navigation.cy.ts +3 -3
- package/tests/cypress/e2e/_utils/selectors/dashboard-sidebar.bdd.md +38 -73
- package/tests/cypress/e2e/_utils/selectors/dashboard-sidebar.cy.ts +21 -42
- package/tests/cypress/e2e/_utils/selectors/dashboard-topnav.bdd.md +117 -38
- package/tests/cypress/e2e/_utils/selectors/dashboard-topnav.cy.ts +35 -12
- package/tests/cypress/e2e/_utils/selectors/settings-layout.bdd.md +50 -59
- package/tests/cypress/e2e/_utils/selectors/settings-layout.cy.ts +15 -23
- package/tests/cypress/e2e/_utils/selectors/tasks.bdd.md +395 -155
- package/tests/cypress/e2e/_utils/selectors/tasks.cy.ts +795 -174
- package/tests/cypress/e2e/api/_core/teams/teams-security.cy.ts +415 -0
- package/tests/cypress/e2e/uat/_core/teams/inline-edit.cy.ts +278 -0
- package/tests/cypress/src/core/BlockEditorBasePOM.ts +269 -99
- package/tests/cypress/src/core/DashboardEntityPOM.ts +1 -1
- package/tests/cypress/src/features/DashboardPOM.ts +49 -28
- package/tests/cypress/src/features/PageBuilderPOM.ts +20 -0
- package/tests/cypress/src/features/SettingsPOM.ts +511 -166
- package/tests/cypress/src/features/SuperadminPOM.ts +679 -159
- package/tests/cypress/src/features/index.ts +10 -10
- package/tests/cypress/e2e/_utils/selectors/pages-editor.bdd.md +0 -207
- package/tests/cypress/e2e/_utils/selectors/pages-editor.cy.ts +0 -211
- package/tests/cypress/e2e/_utils/selectors/posts-editor.bdd.md +0 -184
- package/tests/cypress/e2e/_utils/selectors/posts-editor.cy.ts +0 -350
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* POC Test: Posts Block Editor Selectors Validation
|
|
3
|
-
*
|
|
4
|
-
* This test validates that the new POM architecture with dynamic selectors
|
|
5
|
-
* works correctly for the block-based page builder.
|
|
6
|
-
*
|
|
7
|
-
* Purpose:
|
|
8
|
-
* - Validate selectors from BlockEditorBasePOM work correctly
|
|
9
|
-
* - Ensure dynamic selector generation produces valid CSS selectors
|
|
10
|
-
* - Test before migrating existing tests to new architecture
|
|
11
|
-
*
|
|
12
|
-
* Scope:
|
|
13
|
-
* - Only login and navigate
|
|
14
|
-
* - Assert elements exist in DOM (no full CRUD operations)
|
|
15
|
-
*
|
|
16
|
-
* Test IDs:
|
|
17
|
-
* - SEL_PTED_001: Posts List Page Selectors
|
|
18
|
-
* - SEL_PTED_002: Block Editor Core Selectors
|
|
19
|
-
* - SEL_PTED_003: Block Picker Selectors
|
|
20
|
-
* - SEL_PTED_004: Block Canvas Selectors
|
|
21
|
-
* - SEL_PTED_005: Settings Panel Selectors
|
|
22
|
-
* - SEL_PTED_006: Status Selector
|
|
23
|
-
* - SEL_PTED_007: Block Manipulation Selectors
|
|
24
|
-
* - SEL_PTED_008: Post-Specific Selectors
|
|
25
|
-
* - SEL_PTED_009: Edit Existing Post
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
import { PostEditorPOM } from '../../../src/features/PostEditorPOM'
|
|
29
|
-
import { PostsPOM } from '../../../src/entities/PostsPOM'
|
|
30
|
-
import { loginAsDefaultDeveloper } from '../../../src/session-helpers'
|
|
31
|
-
|
|
32
|
-
// Team ID for developer's team (NextSpark Team)
|
|
33
|
-
const DEVELOPER_TEAM_ID = 'team-nextspark-001'
|
|
34
|
-
|
|
35
|
-
describe('Posts Block Editor Selectors Validation', { tags: ['@ui-selectors', '@posts', '@editor'] }, () => {
|
|
36
|
-
const postEditor = PostEditorPOM.create()
|
|
37
|
-
const posts = PostsPOM.create()
|
|
38
|
-
|
|
39
|
-
beforeEach(() => {
|
|
40
|
-
loginAsDefaultDeveloper()
|
|
41
|
-
// Set team context for entity API calls (posts is team-based)
|
|
42
|
-
cy.window().then((win) => {
|
|
43
|
-
win.localStorage.setItem('activeTeamId', DEVELOPER_TEAM_ID)
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
// ============================================
|
|
48
|
-
// SEL_PTED_001: POSTS LIST PAGE SELECTORS
|
|
49
|
-
// ============================================
|
|
50
|
-
describe('SEL_PTED_001: Posts List Page Selectors', { tags: '@SEL_PTED_001' }, () => {
|
|
51
|
-
beforeEach(() => {
|
|
52
|
-
posts.visitList()
|
|
53
|
-
posts.waitForList()
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
it('should find posts table container', () => {
|
|
57
|
-
cy.get(posts.selectors.tableContainer).should('exist')
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
it('should find posts add button', () => {
|
|
61
|
-
cy.get(posts.selectors.addButton).should('exist')
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
it('should find posts search input', () => {
|
|
65
|
-
cy.get(posts.selectors.search).should('exist')
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
// NOTE: Pagination only shows when there are posts
|
|
69
|
-
// This test is conditional - passes if data exists, otherwise logs warning
|
|
70
|
-
it('should find posts pagination (requires sample data)', () => {
|
|
71
|
-
cy.get('body').then(($body) => {
|
|
72
|
-
// Check if rows exist (not empty state)
|
|
73
|
-
if ($body.find('[data-cy^="posts-row-"]').length === 0) {
|
|
74
|
-
cy.log('⚠️ No posts found - pagination not visible (add sample data)')
|
|
75
|
-
return // Skip gracefully
|
|
76
|
-
}
|
|
77
|
-
cy.get(posts.selectors.pagination).should('exist')
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
// NOTE: Conditional test - requires sample posts data
|
|
82
|
-
it('should find at least one post row (requires sample data)', () => {
|
|
83
|
-
cy.get('body').then(($body) => {
|
|
84
|
-
// Check if rows exist
|
|
85
|
-
if ($body.find('[data-cy^="posts-row-"]').length === 0) {
|
|
86
|
-
cy.log('⚠️ No posts found - skipping row test (add sample data)')
|
|
87
|
-
return // Skip gracefully
|
|
88
|
-
}
|
|
89
|
-
cy.get(posts.selectors.rowGeneric).should('have.length.at.least', 1)
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
// ============================================
|
|
95
|
-
// SEL_PTED_002: BLOCK EDITOR CORE SELECTORS
|
|
96
|
-
// ============================================
|
|
97
|
-
describe('SEL_PTED_002: Block Editor Core Selectors', { tags: '@SEL_PTED_002' }, () => {
|
|
98
|
-
beforeEach(() => {
|
|
99
|
-
postEditor.visitCreate()
|
|
100
|
-
postEditor.waitForEditor()
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
it('should find editor container', () => {
|
|
104
|
-
cy.get(postEditor.editorSelectors.container).should('exist')
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
it('should find title input', () => {
|
|
108
|
-
cy.get(postEditor.editorSelectors.titleInput).should('exist')
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
it('should find slug input', () => {
|
|
112
|
-
cy.get(postEditor.editorSelectors.slugInput).should('exist')
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
it('should find save button', () => {
|
|
116
|
-
cy.get(postEditor.editorSelectors.saveButton).should('exist')
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
it('should find status badge', () => {
|
|
120
|
-
cy.get(postEditor.editorSelectors.statusBadge).should('exist')
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
it('should find left sidebar toggle', () => {
|
|
124
|
-
cy.get(postEditor.editorSelectors.leftSidebarToggle).should('exist')
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
it('should find view mode toggle', () => {
|
|
128
|
-
cy.get(postEditor.editorSelectors.viewModeToggle).should('exist')
|
|
129
|
-
})
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
// ============================================
|
|
133
|
-
// SEL_PTED_003: BLOCK PICKER SELECTORS
|
|
134
|
-
// ============================================
|
|
135
|
-
describe('SEL_PTED_003: Block Picker Selectors', { tags: '@SEL_PTED_003' }, () => {
|
|
136
|
-
beforeEach(() => {
|
|
137
|
-
postEditor.visitCreate()
|
|
138
|
-
postEditor.waitForEditor()
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
it('should find block picker container', () => {
|
|
142
|
-
cy.get(postEditor.editorSelectors.blockPicker).should('exist')
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
it('should find block search input', () => {
|
|
146
|
-
cy.get(postEditor.editorSelectors.blockSearch).should('exist')
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
it('should find category "All" button', () => {
|
|
150
|
-
cy.get(postEditor.editorSelectors.categoryAll).should('exist')
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
it('should find block items with dynamic selectors', () => {
|
|
154
|
-
// Test a known block slug - post-content is the main content block for posts
|
|
155
|
-
cy.get(postEditor.editorSelectors.blockItem('post-content')).should('exist')
|
|
156
|
-
cy.get(postEditor.editorSelectors.addBlock('post-content')).should('exist')
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
it('should find category selectors', () => {
|
|
160
|
-
// Categories should be visible
|
|
161
|
-
cy.get(postEditor.editorSelectors.category('content')).should('exist')
|
|
162
|
-
})
|
|
163
|
-
})
|
|
164
|
-
|
|
165
|
-
// ============================================
|
|
166
|
-
// SEL_PTED_004: BLOCK CANVAS SELECTORS
|
|
167
|
-
// ============================================
|
|
168
|
-
describe('SEL_PTED_004: Block Canvas Selectors', { tags: '@SEL_PTED_004' }, () => {
|
|
169
|
-
beforeEach(() => {
|
|
170
|
-
postEditor.visitCreate()
|
|
171
|
-
postEditor.waitForEditor()
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
it('should find empty state when no blocks added', () => {
|
|
175
|
-
cy.get(postEditor.editorSelectors.blockCanvasEmpty).should('exist')
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
it('should find block canvas container when block is added', () => {
|
|
179
|
-
// Add a block - canvas container appears
|
|
180
|
-
postEditor.addBlock('post-content')
|
|
181
|
-
cy.get(postEditor.editorSelectors.blockCanvas).should('exist')
|
|
182
|
-
})
|
|
183
|
-
})
|
|
184
|
-
|
|
185
|
-
// ============================================
|
|
186
|
-
// SEL_PTED_005: SETTINGS PANEL SELECTORS
|
|
187
|
-
// ============================================
|
|
188
|
-
describe('SEL_PTED_005: Settings Panel Selectors', { tags: '@SEL_PTED_005' }, () => {
|
|
189
|
-
beforeEach(() => {
|
|
190
|
-
postEditor.visitCreate()
|
|
191
|
-
postEditor.waitForEditor()
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
it('should find settings panel empty state when no block selected', () => {
|
|
195
|
-
// When no block is selected, empty state is shown
|
|
196
|
-
cy.get(postEditor.editorSelectors.settingsPanelEmpty).should('exist')
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
it('should find settings panel container when block is selected', () => {
|
|
200
|
-
// Add a block first - settings panel appears with block selected
|
|
201
|
-
postEditor.addBlock('post-content')
|
|
202
|
-
cy.get(postEditor.editorSelectors.settingsPanel).should('exist')
|
|
203
|
-
})
|
|
204
|
-
})
|
|
205
|
-
|
|
206
|
-
// ============================================
|
|
207
|
-
// SEL_PTED_006: STATUS SELECTOR
|
|
208
|
-
// ============================================
|
|
209
|
-
describe('SEL_PTED_006: Status Selector', { tags: '@SEL_PTED_006' }, () => {
|
|
210
|
-
beforeEach(() => {
|
|
211
|
-
postEditor.visitCreate()
|
|
212
|
-
postEditor.waitForEditor()
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
it('should find status selector trigger', () => {
|
|
216
|
-
cy.get(postEditor.editorSelectors.statusSelector).should('exist')
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
it('should find status options when clicked', () => {
|
|
220
|
-
// Scroll into view and click - the selector may be hidden due to sidebar
|
|
221
|
-
cy.get(postEditor.editorSelectors.statusSelector).scrollIntoView().click({ force: true })
|
|
222
|
-
cy.get(postEditor.editorSelectors.statusOption('draft')).should('exist')
|
|
223
|
-
cy.get(postEditor.editorSelectors.statusOption('published')).should('exist')
|
|
224
|
-
})
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
// ============================================
|
|
228
|
-
// SEL_PTED_007: BLOCK MANIPULATION SELECTORS
|
|
229
|
-
// ============================================
|
|
230
|
-
describe('SEL_PTED_007: Block Manipulation Selectors', { tags: '@SEL_PTED_007' }, () => {
|
|
231
|
-
beforeEach(() => {
|
|
232
|
-
postEditor.visitCreate()
|
|
233
|
-
postEditor.waitForEditor()
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
it('should find preview block controls after adding a block', () => {
|
|
237
|
-
// Add a post-content block
|
|
238
|
-
postEditor.addBlock('post-content')
|
|
239
|
-
|
|
240
|
-
// Wait for block to appear using preview-block pattern (not sortable-block)
|
|
241
|
-
// The editor uses preview-block-{id} for the canvas blocks
|
|
242
|
-
cy.get('[data-cy^="preview-block-"]')
|
|
243
|
-
.first()
|
|
244
|
-
.invoke('attr', 'data-cy')
|
|
245
|
-
.then((dataCy) => {
|
|
246
|
-
// Extract ID - format is preview-block-{uuid}
|
|
247
|
-
const match = dataCy?.match(/^preview-block-([a-f0-9-]+)$/)
|
|
248
|
-
const blockId = match ? match[1] : ''
|
|
249
|
-
expect(blockId).to.not.be.empty
|
|
250
|
-
|
|
251
|
-
// Validate preview block selectors (actual selectors in DOM)
|
|
252
|
-
cy.get(postEditor.editorSelectors.previewBlock(blockId)).should('exist')
|
|
253
|
-
cy.get(postEditor.editorSelectors.previewMoveUp(blockId)).should('exist')
|
|
254
|
-
cy.get(postEditor.editorSelectors.previewMoveDown(blockId)).should('exist')
|
|
255
|
-
})
|
|
256
|
-
})
|
|
257
|
-
|
|
258
|
-
// NOTE: sortable-block, drag-handle, duplicate-block selectors don't exist in current implementation
|
|
259
|
-
// The editor uses preview-block pattern instead. Skipping these tests.
|
|
260
|
-
it.skip('should find sortable block controls (sortable-block selectors not implemented)', () => {
|
|
261
|
-
postEditor.addBlock('post-content')
|
|
262
|
-
cy.get('[data-cy^="sortable-block-"]').first().should('exist')
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
it('should find settings panel and tabs after adding a block', () => {
|
|
266
|
-
// Add a post-content block - settings panel appears automatically
|
|
267
|
-
postEditor.addBlock('post-content')
|
|
268
|
-
|
|
269
|
-
// Settings panel should appear with tabs
|
|
270
|
-
cy.get(postEditor.editorSelectors.settingsPanel).should('exist')
|
|
271
|
-
cy.get(postEditor.editorSelectors.tabContent).should('exist')
|
|
272
|
-
cy.get(postEditor.editorSelectors.tabDesign).should('exist')
|
|
273
|
-
cy.get(postEditor.editorSelectors.tabAdvanced).should('exist')
|
|
274
|
-
})
|
|
275
|
-
|
|
276
|
-
it('should find block settings actions', () => {
|
|
277
|
-
postEditor.addBlock('post-content')
|
|
278
|
-
|
|
279
|
-
// Settings panel actions
|
|
280
|
-
cy.get(postEditor.editorSelectors.resetProps).should('exist')
|
|
281
|
-
cy.get(postEditor.editorSelectors.removeBlockSettings).should('exist')
|
|
282
|
-
})
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
// ============================================
|
|
286
|
-
// SEL_PTED_008: POST-SPECIFIC SELECTORS
|
|
287
|
-
// ============================================
|
|
288
|
-
describe('SEL_PTED_008: Post-Specific Selectors', { tags: '@SEL_PTED_008' }, () => {
|
|
289
|
-
beforeEach(() => {
|
|
290
|
-
postEditor.visitCreate()
|
|
291
|
-
postEditor.waitForEditor()
|
|
292
|
-
// Switch to "Campos" tab to see entity fields
|
|
293
|
-
cy.get('[data-cy="sidebar-fields"]').click()
|
|
294
|
-
})
|
|
295
|
-
|
|
296
|
-
it('should find excerpt input', () => {
|
|
297
|
-
cy.get(postEditor.postSelectors.excerptInput).should('exist')
|
|
298
|
-
})
|
|
299
|
-
|
|
300
|
-
it('should find featured image input', () => {
|
|
301
|
-
cy.get(postEditor.postSelectors.featuredImage).should('exist')
|
|
302
|
-
})
|
|
303
|
-
|
|
304
|
-
// NOTE: Categories and Locale selectors don't have data-cy attributes yet
|
|
305
|
-
// These tests are skipped until the component adds proper selectors
|
|
306
|
-
it.skip('should find categories select (missing data-cy)', () => {
|
|
307
|
-
cy.get(postEditor.postSelectors.categoriesSelect).should('exist')
|
|
308
|
-
})
|
|
309
|
-
|
|
310
|
-
it.skip('should find locale select (missing data-cy)', () => {
|
|
311
|
-
cy.get(postEditor.postSelectors.localeSelect).should('exist')
|
|
312
|
-
})
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
// ============================================
|
|
316
|
-
// SEL_PTED_009: EDIT EXISTING POST
|
|
317
|
-
// ============================================
|
|
318
|
-
describe('SEL_PTED_009: Edit Existing Post', { tags: '@SEL_PTED_009' }, () => {
|
|
319
|
-
it('should find editor elements when editing an existing post (requires sample data)', () => {
|
|
320
|
-
// Get a post ID from the list
|
|
321
|
-
posts.visitList()
|
|
322
|
-
posts.waitForList()
|
|
323
|
-
|
|
324
|
-
// Conditional: skip if no posts exist
|
|
325
|
-
cy.get('body').then(($body) => {
|
|
326
|
-
// Check if rows exist
|
|
327
|
-
if ($body.find('[data-cy^="posts-row-"]').length === 0) {
|
|
328
|
-
cy.log('⚠️ No posts found - skipping edit test (add sample data)')
|
|
329
|
-
return // Skip gracefully
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
cy.get(posts.selectors.rowGeneric)
|
|
333
|
-
.first()
|
|
334
|
-
.invoke('attr', 'data-cy')
|
|
335
|
-
.then((dataCy) => {
|
|
336
|
-
const id = dataCy?.replace('posts-row-', '') || ''
|
|
337
|
-
|
|
338
|
-
// Navigate to edit
|
|
339
|
-
postEditor.visitEdit(id)
|
|
340
|
-
postEditor.waitForEditor()
|
|
341
|
-
|
|
342
|
-
// Validate editor is loaded with existing content
|
|
343
|
-
cy.get(postEditor.editorSelectors.container).should('exist')
|
|
344
|
-
cy.get(postEditor.editorSelectors.titleInput).should('exist')
|
|
345
|
-
cy.get(postEditor.editorSelectors.saveButton).should('exist')
|
|
346
|
-
})
|
|
347
|
-
})
|
|
348
|
-
})
|
|
349
|
-
})
|
|
350
|
-
})
|