File size: 843 Bytes
b91e262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { nextTestSetup } from 'e2e-utils'
import { getDevIndicatorPosition } from './utils'

describe('devtools-position-persistence', () => {
  const { next } = nextTestSetup({
    files: __dirname,
    nextConfig: {
      devIndicators: {
        position: 'top-right',
      },
    },
  })

  it('should maintain devtools indicator position after navigation', async () => {
    const browser = await next.browser('/')

    let style = await getDevIndicatorPosition(browser)

    expect(style).toContain('top: 20px')
    expect(style).toContain('right: 20px')

    // Navigate and check devtools indicator position is maintained
    await browser.refresh()
    await browser.waitForIdleNetwork()

    style = await getDevIndicatorPosition(browser)

    expect(style).toContain('top: 20px')
    expect(style).toContain('right: 20px')
  })
})