generated from taylorbryant/gatsby-starter-tailwind
-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7538446
commit 7e1bd67
Showing
1 changed file
with
19 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,23 @@ | ||
// import '@testing-library/jest-dom/extend-expect' | ||
// import { render, screen } from '@testing-library/react' | ||
// import PhotoMontage from '../PhotoMontage' | ||
// import { mediaList } from './data' | ||
import '@testing-library/jest-dom/extend-expect' | ||
import { render, screen } from '@testing-library/react' | ||
import PhotoMontage from '../PhotoMontage' | ||
import { mediaList } from './data' | ||
|
||
// test('PhotoMontage can render 1 photo', async () => { | ||
// render(<PhotoMontage photoList={mediaList.slice(0, 1)} isHero />) | ||
// const elements: HTMLImageElement[] = await screen.findAllByRole('img') | ||
// expect(elements.length).toBe(1) | ||
// expect(elements[0].src).toContain(mediaList[0].mediaUrl) | ||
// }) | ||
|
||
// test('PhotoMontage always renders 2 photos when provided with a list of 2 to 4', async () => { | ||
// render(<PhotoMontage photoList={mediaList.slice(0, 3)} isHero />) | ||
// const elements: HTMLImageElement[] = await screen.findAllByRole('img') | ||
// expect(elements.length).toBe(2) // should be 2 | ||
// }) | ||
|
||
// test('PhotoMontage always renders 5 photos when provided with a list > 5', async () => { | ||
// render(<PhotoMontage photoList={mediaList} isHero />) | ||
// const elements: HTMLImageElement[] = await screen.findAllByRole('img') | ||
// expect(elements.length).toBe(5) // should be 5 | ||
// }) | ||
test('PhotoMontage can render 1 photo', async () => { | ||
render(<PhotoMontage photoList={mediaList.slice(0, 1)} isHero />) | ||
const elements: HTMLImageElement[] = await screen.findAllByRole('img') | ||
expect(elements.length).toBe(1) | ||
expect(elements[0].src).toContain(mediaList[0].mediaUrl) | ||
}) | ||
|
||
describe('basic true test', () => { | ||
test('true is true', () => { | ||
expect(true).toBe(true) | ||
}) | ||
test('PhotoMontage always renders 2 photos when provided with a list of 2 to 4', async () => { | ||
render(<PhotoMontage photoList={mediaList.slice(0, 3)} isHero />) | ||
const elements: HTMLImageElement[] = await screen.findAllByRole('img') | ||
expect(elements.length).toBe(2) // should be 2 | ||
}) | ||
|
||
// commenting out to get the commit to pass | ||
// will need to fix this later | ||
test('PhotoMontage always renders 5 photos when provided with a list > 5', async () => { | ||
render(<PhotoMontage photoList={mediaList} isHero />) | ||
const elements: HTMLImageElement[] = await screen.findAllByRole('img') | ||
expect(elements.length).toBe(5) // should be 5 | ||
}) |