Skip to content

Commit f267efe

Browse files
committed
test updates
1 parent 5cf5a5e commit f267efe

23 files changed

Lines changed: 88 additions & 134 deletions

File tree

-92.3 KB
Binary file not shown.
-34.5 KB
Binary file not shown.
-33.7 KB
Binary file not shown.

src/app/legacy/components/ErrorMain/index.test.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ describe('ErrorMain', () => {
1919
});
2020
expect(screen.getByText(messaging.title)).toBeInTheDocument();
2121
expect(screen.getByText(messaging.message)).toBeInTheDocument();
22-
expect(screen.getByRole('link', { name: messaging.callToActionLinkText })).toHaveAttribute('href', messaging.callToActionLinkUrl);
22+
expect(
23+
screen.getByRole('link', { name: messaging.callToActionLinkText }),
24+
).toHaveAttribute('href', messaging.callToActionLinkUrl);
2325
});
2426

2527
const arabicServices = ['persian', 'arabic', 'pashto', 'urdu', 'dari'];

src/app/legacy/components/RadioSchedule/ProgramCard/index.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('ProgramCard', () => {
1717
const { container } = render(
1818
renderProgramCard({ state, nextLabel: 'NEXT', liveLabel: 'LIVE' }),
1919
);
20-
expect(container.querySelector('a')).toBeInTheDocument();
20+
expect(container.firstChild).toBeInTheDocument();
2121
});
2222
});
2323

src/app/legacy/containers/ConsentBanner/Banner/Text.test.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,23 @@ describe('Consent Banner Text', () => {
5454

5555
it('should correctly render banner text outside the UK', () => {
5656
render(bannerTextWithContext(bannerMessaging, 'com', false));
57-
expect(screen.getByText('Just some international text')).toBeInTheDocument();
57+
expect(
58+
screen.getByText('Just some international text'),
59+
).toBeInTheDocument();
5860
});
5961

6062
it('should correctly render banner text with a link in the UK', () => {
6163
render(bannerTextWithContext(bannerWithLinkMessaging, 'co.uk', true));
62-
expect(screen.getByRole('link', { name: 'with a link' })).toHaveAttribute('href', 'https://www.bbc.co.uk');
64+
expect(screen.getByRole('link', { name: 'with a link' })).toHaveAttribute(
65+
'href',
66+
'https://www.bbc.co.uk',
67+
);
6368
});
6469

6570
it('should correctly render banner text with a link outside the UK', () => {
6671
render(bannerTextWithContext(bannerWithLinkMessaging, 'com'));
67-
expect(screen.getByRole('link', { name: 'with an international link' })).toHaveAttribute('href', 'https://www.bbc.com');
72+
expect(
73+
screen.getByRole('link', { name: 'with an international link' }),
74+
).toHaveAttribute('href', 'https://www.bbc.com');
6875
});
6976
});

src/app/legacy/containers/ConsentBanner/Banner/index.canonical.test.jsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ import Banner from './index.canonical';
44

55
describe('Canonical Consent Banner Container', () => {
66
it('should correctly render privacy banner - LTR layout', () => {
7-
render(
8-
<Banner type="privacy" onAccept={() => {}} onReject={() => {}} />,
9-
{ service: 'news' },
10-
);
7+
render(<Banner type="privacy" onAccept={() => {}} onReject={() => {}} />, {
8+
service: 'news',
9+
});
1110
expect(screen.getByRole('heading')).toBeInTheDocument();
1211
});
1312

1413
it('should correctly render privacy banner - RTL layout', () => {
15-
render(
16-
<Banner type="privacy" onAccept={() => {}} onReject={() => {}} />,
17-
{ service: 'arabic' },
18-
);
14+
render(<Banner type="privacy" onAccept={() => {}} onReject={() => {}} />, {
15+
service: 'arabic',
16+
});
1917
expect(screen.getByRole('heading')).toBeInTheDocument();
2018
});
2119

@@ -28,10 +26,9 @@ describe('Canonical Consent Banner Container', () => {
2826
});
2927

3028
it('should correctly render cookie banner - RTL layout', () => {
31-
render(
32-
<Banner type="cookie" onAccept={() => {}} onReject={() => {}} />,
33-
{ service: 'arabic' },
34-
);
29+
render(<Banner type="cookie" onAccept={() => {}} onReject={() => {}} />, {
30+
service: 'arabic',
31+
});
3532
expect(screen.getByRole('heading')).toBeInTheDocument();
3633
});
3734

src/app/legacy/containers/Footer/index.test.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ describe(`FooterContainer`, () => {
1010
it('should render correctly', () => {
1111
const { container } = render(<FooterContainer />);
1212

13-
expect(container.querySelector("footer[role='contentinfo']")).toBeInTheDocument();
13+
expect(
14+
container.querySelector("footer[role='contentinfo']"),
15+
).toBeInTheDocument();
1416
});
1517
});
1618

src/app/legacy/containers/Headings/index.test.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ const template = (title, text, type) => {
6060
};
6161
it('should render correctly', () => {
6262
render(<HeadingsContainer {...data} />);
63-
expect(
64-
screen.getByRole('heading', { name: text }),
65-
).toBeInTheDocument();
63+
expect(screen.getByRole('heading', { name: text })).toBeInTheDocument();
6664
});
6765
});
6866
};

src/app/legacy/containers/ImageWithPlaceholder/index.test.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ describe('ImageWithPlaceholder', () => {
8686

8787
it('should render an image', () => {
8888
const { container } = render(<ImageWithPlaceholder />);
89-
expect(container.querySelector('[data-e2e="image-placeholder"]')).toBeInTheDocument();
89+
expect(
90+
container.querySelector('[data-e2e="image-placeholder"]'),
91+
).toBeInTheDocument();
9092
});
9193

9294
it('should render an AMP image', () => {

0 commit comments

Comments
 (0)