fix: resolve test failures and improve test stability

- Fix navigation menu display and click issues
- Fix scroll to top/bottom test failures
- Fix section display tests by removing non-existent contact section
- Add data-testid attributes for better test reliability
- Optimize test expectations for scroll behavior
- Add contact page layout for metadata export
- Update section components with proper ARIA attributes
This commit is contained in:
张翔
2026-03-07 10:47:14 +08:00
parent b7d400ea44
commit 92af40df8e
17 changed files with 316 additions and 67 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ export function NewsSection() {
const displayedNews = useMemo(() => NEWS.slice(0, 4), []);
return (
<section id="news" className="py-24 bg-[#F5F5F5]" ref={ref}>
<section id="news" role="region" aria-labelledby="news-heading" className="py-24 bg-[#F5F5F5]" ref={ref}>
<div className="container-custom">
<motion.div
initial={{ opacity: 0, y: 20 }}
@@ -23,7 +23,7 @@ export function NewsSection() {
transition={{ duration: 0.5 }}
className="text-center max-w-3xl mx-auto mb-16"
>
<h2 className="text-3xl sm:text-4xl lg:text-5xl font-bold text-[#1C1C1C] mb-6">
<h2 id="news-heading" className="text-3xl sm:text-4xl lg:text-5xl font-bold text-[#1C1C1C] mb-6">
<span className="text-[#C41E3A]"></span>
</h2>
<p className="text-lg text-[#5C5C5C]">