Skip to content

Commit 7779591

Browse files
committed
fix storybook + remove hardcoding in decideFormat
1 parent e1f8bc4 commit 7779591

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

dotcom-rendering/src/layouts/HostedArticleLayout.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { Meta, StoryObj } from '@storybook/react-webpack5';
22
import { allModes } from '../../.storybook/modes';
3+
import { Labs as LabsFixture } from '../../fixtures/generated/fe-articles/Labs';
4+
import { enhanceArticleType } from '../types/article';
35
import { HostedArticleLayout } from './HostedArticleLayout';
46

57
const meta = {
@@ -20,6 +22,7 @@ type Story = StoryObj<typeof meta>;
2022

2123
export const Apps = {
2224
args: {
25+
content: enhanceArticleType(LabsFixture, 'Apps'),
2326
renderingTarget: 'Apps',
2427
},
2528
parameters: {
@@ -31,6 +34,7 @@ export const Apps = {
3134

3235
export const Web = {
3336
args: {
37+
content: enhanceArticleType(LabsFixture, 'Web'),
3438
renderingTarget: 'Web',
3539
},
3640
parameters: {

dotcom-rendering/src/lib/articleFormat.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,7 @@ export const decideTheme = ({ theme }: Partial<FEFormat>): ArticleTheme => {
176176
}
177177
};
178178

179-
export const decideFormat = (
180-
format: Partial<FEFormat> = {
181-
// TODO: Only here for testing. Please remove this!
182-
design: 'HostedArticle',
183-
display: 'StandardDisplay',
184-
theme: 'Labs',
185-
},
186-
): ArticleFormat => ({
179+
export const decideFormat = (format: Partial<FEFormat>): ArticleFormat => ({
187180
design: decideDesign(format),
188181
display: decideDisplay(format),
189182
theme: decideTheme(format),

0 commit comments

Comments
 (0)