Skip to content

Commit 27b5a10

Browse files
authored
Merge branch 'Dev' into shop-homepage-redesign
2 parents ea980e4 + 186ac75 commit 27b5a10

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

src/components/Footer.jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ function Footer() {
8585
const year = now.getFullYear();
8686

8787
return (
88-
<footer className="bg-secondary text-white">
89-
<div className="md:p-12 py-8 px-4 relative max-w-[1440px] mx-auto">
88+
<footer className="bg-secondary text-white" data-testid="footer-section">
89+
<div className="md:px-12 md:pt-8 md:pb-[2px] py-8 px-4 max-w-[1440px] mx-auto">
9090
<div className="flex lg:flex-row flex-col md:gap-16 gap-8">
9191
<div className="flex-3 flex flex-col items-center">
9292
{/* logo */}
9393
<LazyLoadImage
9494
src={logo}
9595
alt="logo"
96-
className="w-[124px] h-32 md:ml-0 ml-4 object-contain"
96+
className="h-20 md:ml-0 ml-4 object-contain"
9797
/>
9898
{/* socials */}
9999
<div className="flex gap-4 items-center py-4">
@@ -104,7 +104,7 @@ function Footer() {
104104
target="_blank"
105105
rel="noopener noreferrer"
106106
aria-label={link.label}
107-
className="w-7 h-7 text-white"
107+
className="w-5 h-5 text-white"
108108
>
109109
{link.icon}
110110
</a>
@@ -117,7 +117,7 @@ function Footer() {
117117
href={link.href}
118118
target="_blank"
119119
rel="noopener noreferrer"
120-
className="w-7 h-7 text-white"
120+
className="w-5 h-5 text-white"
121121
>
122122
{link.icon}
123123
</a>
@@ -126,17 +126,17 @@ function Footer() {
126126
</div>
127127

128128
{/* Footer links */}
129-
<div className="grid grid-cols-1 sm:grid-cols-3 gap-12 sm:gap-8">
129+
<div className="grid grid-cols-1 sm:grid-cols-3 md:gap-12 gap-8">
130130
{footerLinks.map((section) => (
131131
<div
132132
key={crypto.randomUUID()}
133-
className="flex flex-col gap-8 text-center lg:text-left"
133+
className="flex flex-col gap-2 md:gap-4 text-center lg:text-left"
134134
>
135-
<h2 className="text-green-footer font-bold sm:text-xl text-lg leading-9">
135+
<h2 className="text-green-footer font-bold sm:text-xl text-lg md:leading-9">
136136
{section.title}
137137
</h2>
138138

139-
<ul className="flex flex-col gap-5 list-none text-sm font-light">
139+
<ul className="flex flex-col gap-3 md:gap-5 list-none text-sm font-light">
140140
{section.links.map((link) =>
141141
link.href ? (
142142
<li key={crypto.randomUUID()}>
@@ -162,7 +162,7 @@ function Footer() {
162162

163163
{/* Newsletter */}
164164
<div className="flex-2">
165-
<div className="flex flex-col md:gap-8">
165+
<div className="flex flex-col gap-2 md:gap-4">
166166
<h2 className="text-green-footer font-bold sm:text-xl text-lg md:leading-9 mx-auto lg:mx-0 text-center lg:text-left">
167167
Subscribe to our Newsletter
168168
</h2>
@@ -192,8 +192,8 @@ function Footer() {
192192
</div>
193193
</div>
194194
</div>
195-
<div className="sm:mt-14 mt-10">
196-
<h1 className="text-center text-green-footer my-4 md:my-8">
195+
<div>
196+
<h1 className="text-center text-green-footer my-4 ">
197197
&copy; {year} SpaceYaTech | All Rights Reserved
198198
</h1>
199199
</div>

tests/components/footer.spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { expect, test } from "@playwright/test";
2+
3+
test.beforeEach(async ({ page }) => {
4+
await page.goto("http://localhost:5173");
5+
});
6+
7+
test("all links in the Footer component should be valid", async ({ page }) => {
8+
await page.goto("http://localhost:5173");
9+
10+
const component = await page.locator("data-testid=footer-section");
11+
12+
const links = await page.$$eval("data-testid=footer-section a", (anchors) =>
13+
anchors.map((anchor) => anchor.href)
14+
);
15+
16+
// check if the footer section is visible
17+
await expect(component).toBeVisible();
18+
19+
// validate footer links
20+
// eslint-disable-next-line no-restricted-syntax
21+
for (const link of links) {
22+
// eslint-disable-next-line no-await-in-loop
23+
const response = await fetch(link);
24+
expect(response.status).toBe(200);
25+
}
26+
});

0 commit comments

Comments
 (0)