generated from gabrielduete/frontend-template-nextjs
-
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.
Merge pull request #13 from gabrielduete/feat/sections-providers-and-…
…mobile-apps
- Loading branch information
Showing
8 changed files
with
183 additions
and
6 deletions.
There are no files selected for viewing
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
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
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,37 @@ | ||
import { render, fireEvent, screen, waitFor } from '@testing-library/react' | ||
|
||
import SectionApps from '.' | ||
|
||
describe('<SectionApps />', () => { | ||
beforeEach(() => { | ||
render(<SectionApps />) | ||
}) | ||
|
||
it('should render texts and buttons correctly', () => { | ||
expect(screen.getByText(/Download our mobile apps/i)).toBeInTheDocument() | ||
expect( | ||
screen.getByText( | ||
'Our dedicated patient engagement app and web portal allow you to access information instantaneously (no tedeous form, long calls, or administrative hassle) and securely' | ||
) | ||
).toBeInTheDocument() | ||
expect(screen.getByText(/Download /i)).toBeInTheDocument() | ||
}) | ||
|
||
it('should render image in desktop correctly', () => { | ||
expect( | ||
screen.getByAltText('Decorative healthcare apps') | ||
).toBeInTheDocument() | ||
}) | ||
|
||
it('should dont render image in mobile', () => { | ||
window.innerWidth = 500 | ||
|
||
fireEvent(window, new Event('resize')) | ||
|
||
waitFor(() => { | ||
expect( | ||
screen.getByAltText('Decorative healthcare apps') | ||
).not.toBeInTheDocument() | ||
}) | ||
}) | ||
}) |
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,44 @@ | ||
import Button from '../Button' | ||
import Title from '../Title' | ||
|
||
import Image from 'next/image' | ||
|
||
import DownloadIcon from '@mui/icons-material/Download' | ||
|
||
const SectionApps = () => { | ||
return ( | ||
<section className='flex gap-36 items-center justify-center px-9 mb-56'> | ||
<div> | ||
<Title hasLine={true} fontSize='text-4xl' width='max-w-[250px]'> | ||
Download our mobile apps | ||
</Title> | ||
<p className='text-gray-500 text-xl mt-8 mb-11 max-w-[400px]'> | ||
Our dedicated patient engagement app and web portal allow you to | ||
access information instantaneously (no tedeous form, long calls, or | ||
administrative hassle) and securely | ||
</p> | ||
<Button | ||
style='outlined' | ||
content={ | ||
<span className='flex gap-3 items-end'> | ||
Download <DownloadIcon /> | ||
</span> | ||
} | ||
padding='px-11' | ||
textColor='text-blue-500' | ||
/> | ||
</div> | ||
<div className='hidden lg:block'> | ||
<Image | ||
src='https://media.discordapp.net/attachments/778024116140769331/1142600605924335797/mobile-apps.png' | ||
alt='Decorative healthcare apps' | ||
width={650} | ||
height={480} | ||
quality={100} | ||
/> | ||
</div> | ||
</section> | ||
) | ||
} | ||
|
||
export default SectionApps |
39 changes: 39 additions & 0 deletions
39
src/components/SectionProviders/SectioonProviders.spec.tsx
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,39 @@ | ||
import { render, fireEvent, screen, waitFor } from '@testing-library/react' | ||
|
||
import SectionProviders from '.' | ||
|
||
describe('<SectionProviders />', () => { | ||
beforeEach(() => { | ||
render(<SectionProviders />) | ||
}) | ||
|
||
it('should render texts and buttons correctly', () => { | ||
expect( | ||
screen.getByText(/Leading healthcare providers/i) | ||
).toBeInTheDocument() | ||
expect( | ||
screen.getByText( | ||
/Trafalgar provides progressive, and affordable healthcare, accessible on mobile and online for everyone. To us, it’s not just work. We take pride in the solutions we deliver/i | ||
) | ||
).toBeInTheDocument() | ||
expect(screen.getByText(/Learn more/i)).toBeInTheDocument() | ||
}) | ||
|
||
it('should render image in desktop correctly', () => { | ||
expect( | ||
screen.getByAltText('Decorative healthcare providers') | ||
).toBeInTheDocument() | ||
}) | ||
|
||
it('should dont render image in mobile', () => { | ||
window.innerWidth = 500 | ||
|
||
fireEvent(window, new Event('resize')) | ||
|
||
waitFor(() => { | ||
expect( | ||
screen.getByAltText('Decorative healthcare providers') | ||
).not.toBeInTheDocument() | ||
}) | ||
}) | ||
}) |
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,38 @@ | ||
import Button from '../Button' | ||
import Title from '../Title' | ||
|
||
import Image from 'next/image' | ||
|
||
const SectionProviders = () => { | ||
return ( | ||
<section className='flex gap-36 items-center justify-center px-9 mb-56'> | ||
<div className='hidden lg:block'> | ||
<Image | ||
src='https://media.discordapp.net/attachments/778024116140769331/1142600606234718321/providers.png' | ||
alt='Decorative healthcare providers' | ||
width={650} | ||
height={480} | ||
quality={100} | ||
/> | ||
</div> | ||
<div> | ||
<Title hasLine={true} fontSize='text-4xl' width='max-w-[330px]'> | ||
Leading healthcare providers | ||
</Title> | ||
<p className='text-gray-500 text-xl mt-8 mb-9 max-w-[440px]'> | ||
Trafalgar provides progressive, and affordable healthcare, accessible | ||
on mobile and online for everyone. To us, it’s not just work. We take | ||
pride in the solutions we deliver | ||
</p> | ||
<Button | ||
style='outlined' | ||
content='Learn more' | ||
padding='px-11' | ||
textColor='text-blue-500' | ||
/> | ||
</div> | ||
</section> | ||
) | ||
} | ||
|
||
export default SectionProviders |
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
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