-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement "Most Popular" Section on Landing Page #27
- Loading branch information
Showing
5 changed files
with
57 additions
and
54 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { describe, it, expect } from 'vitest'; // Assuming 'vitest' is used for assertions | ||
import BannerAD from '@/components/Popular-section/BannerAD'; // Adjust path as needed | ||
import ADImage from '@/assets/image/Rectangle 901.svg'; // Adjust path as needed | ||
|
||
describe('BannerAD Component', () => { | ||
it('renders BannerAD component correctly', () => { | ||
render(<BannerAD />); | ||
|
||
const headline = screen.getByText( | ||
'In store or online your health & safety is our priority' | ||
); | ||
expect(headline).toBeInTheDocument(); | ||
|
||
const description = screen.getByText( | ||
'The only E-commerce that makes your life easier, makes you enjoy life and makes it bette' | ||
); | ||
expect(description).toBeInTheDocument(); | ||
|
||
const adImage = screen.getByAltText('AD image'); | ||
expect(adImage).toBeInTheDocument(); | ||
expect(adImage.getAttribute('src')).toBe(ADImage); // Ensure correct image source | ||
}); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { describe, it, expect } from 'vitest'; // Assuming 'vitest' is used for assertions | ||
import PopularTitle from '@/components/Popular-section/PopilarTitle'; // Adjust path as needed | ||
// import leftIcon from '../../assets/icon/Left-Arrow.svg'; // Adjust path as needed | ||
// import rightIcon from '../../assets/icon/Right-Arrow.svg'; // Adjust path as needed | ||
|
||
describe('PopularTitle Component', () => { | ||
it('renders PopularTitle component with given props', () => { | ||
// Mock functions for left and right arrow clicks | ||
const mockLeftArrowClick = () => {}; | ||
const mockRightArrowClick = () => {}; | ||
|
||
render( | ||
<PopularTitle | ||
section="Popular Section" | ||
onLeftArrowClick={mockLeftArrowClick} | ||
onRightArrowClick={mockRightArrowClick} | ||
/> | ||
); | ||
|
||
expect(screen.getByText('Popular Section')).toBeInTheDocument(); | ||
|
||
const leftArrow = screen.getByAltText('Left Arrow Icon'); | ||
expect(leftArrow).toBeInTheDocument(); | ||
|
||
const rightArrow = screen.getByAltText('Right Arrow Icon'); | ||
expect(rightArrow).toBeInTheDocument(); | ||
|
||
// Simulate click events on arrows (you may need to adjust this part based on your testing environment) | ||
leftArrow.click(); | ||
rightArrow.click(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.