Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dotcom-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"@types/webpack-env": "1.18.8",
"@types/webpack-node-externals": "3.0.4",
"@types/youtube": "0.0.50",
"@typescript-eslint/eslint-plugin": "8.57.1",
"@typescript-eslint/eslint-plugin": "8.70.0",
"ajv": "8.18.0",
"ajv-formats": "2.1.1",
"aws-cdk": "catalog:",
Expand All @@ -110,15 +110,15 @@
"dynamic-import-polyfill": "0.1.1",
"eslint": "catalog:",
"eslint-config-prettier": "10.1.8",
"eslint-import-resolver-typescript": "4.4.4",
"eslint-import-resolver-typescript": "4.4.5",
"eslint-plugin-custom-elements": "0.0.8",
"eslint-plugin-import-x": "4.16.2",
"eslint-plugin-import-x": "4.17.1",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-prettier": "5.5.5",
"eslint-plugin-prettier": "5.5.6",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-hooks": "7.1.1",
"eslint-plugin-ssr-friendly": "1.3.0",
"eslint-plugin-unicorn": "64.0.0",
"eslint-plugin-unicorn": "65.0.0",
"eslint-stats": "1.0.1",
"express": "5.2.1",
"find": "0.3.0",
Expand Down Expand Up @@ -160,7 +160,7 @@
"tsx": "4.23.13",
"type-fest": "catalog:",
"typescript": "catalog:",
"typescript-eslint": "8.57.1",
"typescript-eslint": "8.70.0",
"typescript-json-schema": "0.64.0",
"unified": "11.0.5",
"url": "0.11.4",
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/scripts/jest/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ if (!isServer) {
* DOM and NodeJS versions of `TextDecoder`. This affect the running of the application and
* allows us to update jsdom.
*/
global.TextEncoder = TextEncoder as unknown as typeof global.TextEncoder;
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder as unknown as typeof global.TextDecoder;
global.ReadableStream =
ReadableStream as unknown as typeof global.ReadableStream;
Expand Down
3 changes: 1 addition & 2 deletions dotcom-rendering/src/components/MultiBylines.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
getAllThemes,
Pillar,
} from '../lib/articleFormat';
import type { EditionId } from '../lib/edition';
import { RenderArticleElement } from '../lib/renderElement';
import type { TextBlockElement } from '../types/content';
import { MultiBylines } from './MultiBylines';
Expand Down Expand Up @@ -76,7 +75,7 @@ export const ThemeVariations = meta.story({
* but there are no rich links in this example.
*/
ajaxUrl: '',
editionId: 'UK' as EditionId,
editionId: 'UK',
isAdFreeUser: false,
isSensitive: false,
pageId: 'testID',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('NewsletterSignupForm', () => {
if (window.guardian.ophan) {
window.guardian.ophan.pageViewId = 'test-page-view-id';
}
global.fetch = jest.fn().mockResolvedValue({ ok: true } as Response);
global.fetch = jest.fn().mockResolvedValue({ ok: true });
});

it('submits for a signed-out user and includes marketing/browser fields', async () => {
Expand Down Expand Up @@ -406,9 +406,7 @@ describe('NewsletterSignupForm', () => {

it('shows failure UI with retry', async () => {
const testUser = user.setup();
global.fetch = jest
.fn()
.mockResolvedValue({ ok: false, status: 500 } as Response);
global.fetch = jest.fn().mockResolvedValue({ ok: false, status: 500 });

renderForm();

Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/src/components/SecureSignup.island.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe('SecureSignup — US marketing toggle hiding', () => {
if (window.guardian.ophan) {
window.guardian.ophan.pageViewId = 'test-page-view-id';
}
global.fetch = jest.fn().mockResolvedValue({ ok: true } as Response);
global.fetch = jest.fn().mockResolvedValue({ ok: true });
});

// captchaSiteKey is set in a useEffect — wait for the reCAPTCHA widget
Expand Down Expand Up @@ -320,7 +320,7 @@ describe('SecureSignup tracking component id', () => {
(useCountryCode as jest.Mock).mockReturnValue('GB');

window.guardian.config.switches['usSignupHideMarketingToggle'] = false;
global.fetch = jest.fn().mockResolvedValue({ ok: true } as Response);
global.fetch = jest.fn().mockResolvedValue({ ok: true });
});

it('always uses the secureSignup component id regardless of abTest variant', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const Default: Story = {
},
tracking: {
...tracking,
componentType: 'ACQUISITIONS_ENGAGEMENT_BANNER' as any,
componentType: 'ACQUISITIONS_ENGAGEMENT_BANNER',
},
articleCounts: {
forTargetedWeeks: 12,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { OphanComponentType } from '@guardian/libs';
import type {
ConfigurableDesign,
HexColour,
Expand Down Expand Up @@ -61,7 +60,7 @@ const mockProps: BannerRenderProps = {
abTestName: 'test',
abTestVariant: 'variant',
campaignCode: 'campaign',
componentType: 'ACQUISITIONS_HEADER' as OphanComponentType,
componentType: 'ACQUISITIONS_HEADER',
products: [],
ophanPageId: 'page-id',
platformId: 'platform-id',
Expand Down Expand Up @@ -112,7 +111,7 @@ const mockProps: BannerRenderProps = {
goalColour: hex('05', '29', '62'),
},
},
} as ConfigurableDesign,
},
bannerChannel: 'contributions',
};

Expand Down Expand Up @@ -214,7 +213,7 @@ describe('DesignableBanner V2', () => {
benefits: [],
},
],
} as BannerRenderProps['choiceCardsSettings'],
},
design: {
...mockProps.design!,
visual: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ export const headerWrapper = (
: secondaryCta;

const renderedMobileContent = mobileContent
? ({
? {
heading: mobileContent.heading,
subheading: mobileContent.subheading,
primaryCta: mobilePrimaryCta,
secondaryCta: mobileSecondaryCta,
} as HeaderRenderedContent)
}
: undefined;

const { abTestName, abTestVariant, componentType, campaignCode } =
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/lib/auxia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const buildAuxiaGateDisplayData = async (
return {
browserId: readerPersonalData.browserId,
auxiaData: response.data,
} as AuxiaGateDisplayData;
};
}
return undefined;
};
4 changes: 2 additions & 2 deletions dotcom-rendering/src/lib/braze/initialiseBraze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const SDK_OPTIONS: braze.InitializationOptions = {
};

const initialiseBraze = async (apiKey: string): Promise<typeof braze> => {
const importedBraze = (await import(
const importedBraze = await import(
/* webpackChunkName: "braze-web-sdk-core" */ '@braze/web-sdk'
)) as unknown as typeof braze;
);

importedBraze.setLogger((message) => log('tx', message));
importedBraze.initialize(apiKey, SDK_OPTIONS);
Expand Down
8 changes: 2 additions & 6 deletions dotcom-rendering/src/lib/decide-cation.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import type {
EmbedBlockElement,
ImageBlockElement,
TextBlockElement,
} from '../types/content';
import type { EmbedBlockElement, ImageBlockElement } from '../types/content';
import { decideMainMediaCaption } from './decide-caption';

describe('decideMainMediaCaption', () => {
Expand All @@ -16,7 +12,7 @@ describe('decideMainMediaCaption', () => {
elementId: 'test-id',
html: '<p>test</p>',
_type: 'model.dotcomrendering.pageElements.TextBlockElement',
} as TextBlockElement),
}),
).toEqual('');
});
});
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/model/enhanceCards.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ describe('Enhance Cards', () => {
meta: {
headline: undefined,
},
} as VariantMeta,
},
],
} as EditorialTest,
],
Expand Down
6 changes: 3 additions & 3 deletions dotcom-rendering/src/model/validate.puzzlesPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ describe('validateAsPuzzlesPageType', () => {
}
: {}),
};
page.layout.containers.push(container as never);
page.layout.containers.push(container);
expect(validateAsPuzzlesPageType(page)).toBeDefined();
page.layout.containers.push({
...container,
id: 'second-ad',
} as never);
});
expect(() => validateAsPuzzlesPageType(page)).toThrow(
'Unable to validate request body for puzzles page',
);
Expand Down Expand Up @@ -252,7 +252,7 @@ describe('validateAsPuzzlesPageType', () => {
adSlot: 'inline1',
content: { items: [], nestedContainers: [] },
};
page.layout.containers.push(ad as never);
page.layout.containers.push(ad);
expect(validateAsPuzzlesPageType(page).layout.containers).toHaveLength(
2,
);
Expand Down
Loading