PluginProbe
Extendify / 3.1.0
Extendify v3.1.0
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / tests / playwright / Launch / _mocks.ts

_mocks.ts in Extendify 3.1.0, at tests/playwright/Launch/_mocks.ts

158 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Hand-crafted minimal stubs for Launch's mid-flow AI / Patterns / Images
2 // endpoints. Not copies of cypress/fixtures/Launch/data/* — those are real API
3 // captures sized for assertions on response counts that were really just
4 // "whatever the fixture happened to contain at the time." These are sized to
5 // the smallest shape the WP plugin will parse and proceed.
6 //
7 // Later Launch phases extend this file (pageTemplatesStub, goalsStub) — only
8 // pre-bake what the current phase consumes.
9
10 const patternCode =
11 '<!-- wp:paragraph --><p>Test pattern content</p><!-- /wp:paragraph -->';
12
13 export const siteProfileStub = {
14 aiSiteType: 'Test Site Type',
15 aiSiteCategory: 'Business',
16 aiDescription: 'Test description.',
17 aiKeywords: ['test'],
18 };
19
20 export const siteStringsStub = {
21 aiHeaders: ['Headline'],
22 aiBlogTitles: ['Blog Title'],
23 };
24
25 export const stylesStub = [
26 {
27 vibe: 'natural-1',
28 fonts: { heading: 'inter', body: 'inter' },
29 colorPalette: 'home-selection-stub-1',
30 },
31 ];
32
33 export const imagesStub = {
34 siteImages: [
35 {
36 id: 1,
37 url: 'https://images.extendify-cdn.com/demo-content/logos/ext-custom-logo-default.webp',
38 },
39 ],
40 };
41
42 export const pageTemplatesStub = {
43 recommended: [
44 {
45 slug: 'about',
46 name: 'About',
47 siteStyle: {
48 vibe: 'natural-1',
49 fonts: { heading: 'inter', body: 'inter' },
50 colorPalette: 'page-select-stub',
51 },
52 patterns: [
53 {
54 name: 'about-stub',
55 pluginDependency: null,
56 patternMetadata: null,
57 patternTypes: ['about-us'],
58 vibes: ['natural-1'],
59 patternReplacementCode: null,
60 code: patternCode,
61 },
62 ],
63 },
64 {
65 slug: 'services',
66 name: 'Services',
67 siteStyle: {
68 vibe: 'natural-1',
69 fonts: { heading: 'inter', body: 'inter' },
70 colorPalette: 'page-select-stub',
71 },
72 patterns: [
73 {
74 name: 'services-stub',
75 pluginDependency: null,
76 patternMetadata: null,
77 patternTypes: ['services'],
78 vibes: ['natural-1'],
79 patternReplacementCode: null,
80 code: patternCode,
81 },
82 ],
83 },
84 ],
85 optional: [
86 {
87 slug: 'testimonials',
88 name: 'Testimonials',
89 siteStyle: {
90 vibe: 'natural-1',
91 fonts: { heading: 'inter', body: 'inter' },
92 colorPalette: 'page-select-stub',
93 },
94 patterns: [
95 {
96 name: 'testimonials-stub',
97 pluginDependency: null,
98 patternMetadata: null,
99 patternTypes: ['testimonials'],
100 vibes: ['natural-1'],
101 patternReplacementCode: null,
102 code: patternCode,
103 },
104 ],
105 },
106 ],
107 };
108
109 // Cypress historically intercepted `${API_URL}/launch/goals*` with a real
110 // fixture. No live caller exists in the WP plugin today (no /launch/goals REST
111 // route is registered, no JS fetcher targets it) — the intercept is stale.
112 // Stubbed anyway to mirror the Cypress mock set; if a future
113 // caller resurfaces this endpoint, the shape matches the historical payload.
114 export const goalsStub = { data: [], success: true };
115
116 export const homeTemplatesStub = [
117 {
118 id: 'home-stub-1',
119 slug: 'home',
120 siteStyle: {
121 vibe: 'natural-1',
122 fonts: { heading: 'inter', body: 'inter' },
123 colorPalette: 'home-selection-stub-1',
124 },
125 patterns: [
126 {
127 name: 'hero-stub-1',
128 pluginDependency: null,
129 patternMetadata: null,
130 patternTypes: ['hero-header'],
131 vibes: ['natural-1'],
132 patternReplacementCode: null,
133 code: patternCode,
134 },
135 ],
136 },
137 {
138 id: 'home-stub-2',
139 slug: 'home',
140 siteStyle: {
141 vibe: 'natural-1',
142 fonts: { heading: 'inter', body: 'inter' },
143 colorPalette: 'home-selection-stub-2',
144 },
145 patterns: [
146 {
147 name: 'hero-stub-2',
148 pluginDependency: null,
149 patternMetadata: null,
150 patternTypes: ['hero-header'],
151 vibes: ['natural-1'],
152 patternReplacementCode: null,
153 code: patternCode,
154 },
155 ],
156 },
157 ];
158