Skip to content

Commit 536b0d7

Browse files
committed
Cleaned up next-image e2e test for easier extension
1 parent df6e635 commit 536b0d7

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

test/e2e/next-image/app/pages/index.js renamed to test/e2e/next-image/app/pages/farmer-motion.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ const MotionImage = motion(CustomImage)
2020
export default function Page() {
2121
const [clicked, setClicked] = useState(false)
2222
return (
23-
<>
24-
<h1>Framer demo</h1>
25-
<MotionImage
26-
onClick={() => setClicked(true)}
27-
initial={{ opacity: 1 }}
28-
animate={{ opacity: clicked ? 0 : 1 }}
29-
transition={{ duration: 0.5 }}
30-
/>
31-
</>
23+
<MotionImage
24+
onClick={() => setClicked(true)}
25+
initial={{ opacity: 1 }}
26+
animate={{ opacity: clicked ? 0 : 1 }}
27+
transition={{ duration: 0.5 }}
28+
/>
3229
)
3330
}

test/e2e/next-image/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { waitFor } from 'next-test-utils'
44
import path from 'path'
55
import webdriver from 'next-webdriver'
66

7-
describe('next-image', () => {
7+
describe('next-image-forward-ref', () => {
88
let next: NextInstance
99

1010
const appDir = path.join(__dirname, 'app')
@@ -20,7 +20,7 @@ describe('next-image', () => {
2020
afterAll(() => next.destroy())
2121

2222
it('allows framer-motion to animate opacity', async () => {
23-
const browser = await webdriver(next.url, '/')
23+
const browser = await webdriver(next.url, '/framer-motion')
2424
expect(
2525
Number(await browser.elementById('img').getComputedCss('opacity'))
2626
).toBeCloseTo(1)

0 commit comments

Comments
 (0)