Skip to content

Commit

Permalink
feat: more consistent test data-attr in Footer (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyEPhipps authored Feb 18, 2025
1 parent d726bc8 commit 0b40648
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/components/Atoms/SocialIcons/Icon/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Icon = ({
{...restProps}
title={title}
rel="noopener noreferrer"
data-testid={`${isHeader ? 'header' : 'icon'}-${kebabCase(id)}`}
data-test={`${isHeader ? 'header' : 'icon'}-${kebabCase(id)}`}
isHeader={isHeader}
>
<StyledImage src={icon} alt={brand} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ exports[`renders correctly with Comic Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-facebook"
data-test="icon-facebook"
href="https://www.facebook.com/comicrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -84,7 +84,7 @@ exports[`renders correctly with Comic Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-instagram"
data-test="icon-instagram"
href="https://www.instagram.com/comicrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -102,7 +102,7 @@ exports[`renders correctly with Comic Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-twitter"
data-test="icon-twitter"
href="https://twitter.com/comicrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -120,7 +120,7 @@ exports[`renders correctly with Comic Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-youtube"
data-test="icon-youtube"
href="https://www.youtube.com/channel/UCdF5u0ggeSETozc8fsprjcw"
rel="noopener noreferrer"
target="_blank"
Expand Down Expand Up @@ -202,7 +202,7 @@ exports[`renders correctly with Red Nose Day links and self target 1`] = `
>
<a
className="c2"
data-testid="icon-facebook"
data-test="icon-facebook"
href="https://www.facebook.com/rednoseday"
rel="noopener noreferrer"
target="_self"
Expand All @@ -220,7 +220,7 @@ exports[`renders correctly with Red Nose Day links and self target 1`] = `
>
<a
className="c2"
data-testid="icon-instagram"
data-test="icon-instagram"
href="https://www.instagram.com/rednoseday"
rel="noopener noreferrer"
target="_self"
Expand All @@ -238,7 +238,7 @@ exports[`renders correctly with Red Nose Day links and self target 1`] = `
>
<a
className="c2"
data-testid="icon-twitter"
data-test="icon-twitter"
href="https://twitter.com/rednoseday"
rel="noopener noreferrer"
target="_self"
Expand All @@ -256,7 +256,7 @@ exports[`renders correctly with Red Nose Day links and self target 1`] = `
>
<a
className="c2"
data-testid="icon-youtube"
data-test="icon-youtube"
href="https://www.youtube.com/channel/UCdF5u0ggeSETozc8fsprjcw"
rel="noopener noreferrer"
target="_self"
Expand Down Expand Up @@ -338,7 +338,7 @@ exports[`renders correctly with Sport Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-facebook"
data-test="icon-facebook"
href="https://www.facebook.com/sportrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -356,7 +356,7 @@ exports[`renders correctly with Sport Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-instagram"
data-test="icon-instagram"
href="https://www.instagram.com/sportrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -374,7 +374,7 @@ exports[`renders correctly with Sport Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-twitter"
data-test="icon-twitter"
href="https://twitter.com/sportrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -392,7 +392,7 @@ exports[`renders correctly with Sport Relief links 1`] = `
>
<a
className="c2"
data-testid="icon-youtube"
data-test="icon-youtube"
href="https://www.youtube.com/channel/UCdF5u0ggeSETozc8fsprjcw"
rel="noopener noreferrer"
target="_blank"
Expand Down
14 changes: 7 additions & 7 deletions src/components/Molecules/ShareButton/ShareButton.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import "jest-styled-components";
import renderWithTheme from "../../../../tests/hoc/shallowWithTheme";
import ShareButton from "./ShareButton";
import React from 'react';
import 'jest-styled-components';
import renderWithTheme from '../../../../tests/hoc/shallowWithTheme';
import ShareButton from './ShareButton';

it("renders correctly", () => {
it('renders correctly', () => {
const tree = renderWithTheme(<ShareButton />).toJSON();

expect(tree).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -80,7 +80,7 @@ it("renders correctly", () => {
>
<a
className="c4"
data-testid="icon-share-button-facebook"
data-test="icon-share-button-facebook"
href="#"
onClick={[Function]}
rel="noopener noreferrer"
Expand All @@ -100,7 +100,7 @@ it("renders correctly", () => {
>
<a
className="c4"
data-testid="icon-share-button-twitter"
data-test="icon-share-button-twitter"
href="#"
onClick={[Function]}
rel="noopener noreferrer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ exports[`renders correctly 1`] = `
>
<a
className="c5"
data-testid="icon-facebook"
data-test="icon-facebook"
href="https://www.facebook.com/comicrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -577,7 +577,7 @@ exports[`renders correctly 1`] = `
>
<a
className="c5"
data-testid="icon-instagram"
data-test="icon-instagram"
href="https://www.instagram.com/comicrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -595,7 +595,7 @@ exports[`renders correctly 1`] = `
>
<a
className="c5"
data-testid="icon-twitter"
data-test="icon-twitter"
href="https://twitter.com/comicrelief"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -613,7 +613,7 @@ exports[`renders correctly 1`] = `
>
<a
className="c5"
data-testid="icon-youtube"
data-test="icon-youtube"
href="https://www.youtube.com/channel/UCdF5u0ggeSETozc8fsprjcw"
rel="noopener noreferrer"
target="_blank"
Expand Down

0 comments on commit 0b40648

Please sign in to comment.