feat: test id dos restos que faltavam

This commit is contained in:
marlon passos 2023-03-29 13:53:39 -03:00
parent 4ce143ac45
commit 84d5b7a3d3
2 changed files with 25 additions and 9 deletions

View File

@ -6,15 +6,17 @@ interface IconProps {
img: string; img: string;
text: string; text: string;
href: string; href: string;
testId?: string;
} }
const Icon = (props: IconProps) => { const Icon = ({ img, text, href, testId }: IconProps) => (
const { img, text, href } = props;
return (
<a href={href} target="_blank" className={styles["icon"]} rel="noreferrer"> <a href={href} target="_blank" className={styles["icon"]} rel="noreferrer">
<img src={img} alt={text} /> <img
src={img}
alt={text}
data-testid={testId}
/>
</a> </a>
); )
};
export { Icon }; export { Icon };

View File

@ -12,31 +12,45 @@ import styles from "../../footer.module.scss";
const RedeSociais = () => { const RedeSociais = () => {
return ( return (
<div className={styles["page-footer__rede-sociais"]}> <div
<div className={styles["page-footer__rede-sociais-icons"]}> className={styles["page-footer__rede-sociais"]}
data-testid="footer__socialContainer"
>
<div
data-testid="footer__socialIcons"
className={styles["page-footer__rede-sociais-icons"]}>
<Icon <Icon
img={facebook} img={facebook}
href="https://pt-br.facebook.com/digitalm3/" href="https://pt-br.facebook.com/digitalm3/"
text="icone facebook" text="icone facebook"
testId="footer__socialIcon"
/> />
<Icon <Icon
img={instagram} img={instagram}
href="https://www.instagram.com/m3.ecommerce/" href="https://www.instagram.com/m3.ecommerce/"
text="icone instagram" text="icone instagram"
testId="footer__socialIcon"
/> />
<Icon img={twitter} href="https://twitter.com/" text="icone facebook" /> <Icon img={twitter} href="https://twitter.com/" text="icone facebook" />
<Icon <Icon
img={youtube} img={youtube}
href="https://www.youtube.com/channel/UCW4o86gZG_ceA8CmHltXeXA" href="https://www.youtube.com/channel/UCW4o86gZG_ceA8CmHltXeXA"
text="icone youtube" text="icone youtube"
testId="footer__socialIcon"
/> />
<Icon <Icon
img={linkedin} img={linkedin}
href="https://www.linkedin.com/company/11412599/" href="https://www.linkedin.com/company/11412599/"
text="icone linkedin" text="icone linkedin"
testId="footer__socialIcon"
/> />
</div> </div>
<Link className={styles["link"]} link="/" text="www.loremipsum.com" /> <Link
className={styles["link"]}
link="/"
text="www.loremipsum.com"
testId="footer__socialSite"
/>
</div> </div>
); );
}; };