Skip to content

Commit e3bee54

Browse files
authored
Flexible Special : Align live update vertically at boost and mega boost (#13784)
* Align live update vertically at boost and mega boost for flexible special * Add latest links to mock api storybook calls * Keep megaboost live updates as horizontal
1 parent 926861a commit e3bee54

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

dotcom-rendering/src/components/FlexibleSpecial.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const determineCardProperties = (
8787
imageSize: 'jumbo',
8888
supportingContentAlignment:
8989
supportingContentLength >= 3 ? 'horizontal' : 'vertical',
90-
liveUpdatesAlignment: 'horizontal',
90+
liveUpdatesAlignment: 'vertical',
9191
trailTextSize: 'regular',
9292
};
9393
case 'megaboost':

dotcom-rendering/src/lib/mockRESTCalls.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,35 @@ export const mockFetch: typeof global.fetch = (
214214
case /.*ophan\.theguardian\.com\/img\/.*/.test(url):
215215
return createMockResponse(200);
216216

217+
// LatestLinks mock (for e.g., /live-blog/test.json?rendered=false)
218+
case /.*api\.nextgen\.guardianapps\.co\.uk\/.*\.json\?rendered=false/.test(
219+
url,
220+
):
221+
return createMockResponse(200, {
222+
blocks: [
223+
{
224+
id: 'block-1',
225+
title: '',
226+
publishedDateTime: Date.now(),
227+
lastUpdatedDateTime: Date.now(),
228+
body: 'This is the first mocked live update.',
229+
},
230+
{
231+
id: 'block-2',
232+
title: '',
233+
publishedDateTime: Date.now(),
234+
lastUpdatedDateTime: Date.now(),
235+
body: 'Another mocked update just in.',
236+
},
237+
{
238+
id: 'block-3',
239+
title: '',
240+
publishedDateTime: Date.now(),
241+
lastUpdatedDateTime: Date.now(),
242+
body: 'A third update to test spacing.',
243+
},
244+
],
245+
});
217246
// Return an error response if the request body includes the
218247
// phrase 'example.com', otherwise, return a success response.
219248
// For use on stories and tests involving posts to the '/email/many'

0 commit comments

Comments
 (0)