Commit 1cbb5958 authored by JJ Kasper's avatar JJ Kasper Committed by Joe Haddad

Fix syntax error in ie11 from next-server/amp (#8032)

parent 2758060b
const { useAmp } = require('./dist/lib/amp') const amp = require('./dist/lib/amp')
module.exports = { useAmp } module.exports = { useAmp: amp.useAmp }
import { useAmp } from 'next/amp'
if (typeof window !== 'undefined') {
window.addEventListener('error', () => {
document.querySelector('p').innerText('error')
})
}
export const config = { amp: 'hybrid' }
export default () => <p>{useAmp() ? 'AMP' : 'Not AMP'}</p>
...@@ -566,6 +566,13 @@ describe('Production Usage', () => { ...@@ -566,6 +566,13 @@ describe('Production Usage', () => {
expect(text).toMatch(/some interesting title/) expect(text).toMatch(/some interesting title/)
}) })
it('should handle AMP correctly in IE', async () => {
const browser = await webdriver(appPort, '/some-amp')
await waitFor(1000)
const text = await browser.elementByCss('p').text()
expect(text).toBe('Not AMP')
})
dynamicImportTests(context, (p, q) => renderViaHTTP(context.appPort, p, q)) dynamicImportTests(context, (p, q) => renderViaHTTP(context.appPort, p, q))
processEnv(context) processEnv(context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment