Add tests ensuring auto-exported amphtml rel is valid (#9762)
This commit is contained in:
parent
2ba056aa20
commit
87d9b2e03e
3 changed files with 15 additions and 0 deletions
|
@ -151,6 +151,11 @@ describe('AMP Usage', () => {
|
|||
).toBe('http://localhost:1234/use-amp-hook.amp')
|
||||
})
|
||||
|
||||
it('should render amphtml from provided rel link', async () => {
|
||||
const html = await renderViaHTTP(appPort, '/use-amp-hook.amp')
|
||||
await validateAMP(html)
|
||||
})
|
||||
|
||||
it('should render link rel amphtml with existing query', async () => {
|
||||
const html = await renderViaHTTP(appPort, '/use-amp-hook?hello=1')
|
||||
expect(html).not.toMatch(/&amp=1/)
|
||||
|
|
|
@ -76,6 +76,11 @@ describe('Serverless Trace', () => {
|
|||
expect(html).toMatch(/rel="canonical" href="\/some-amp"/)
|
||||
})
|
||||
|
||||
it('should have correct canonical link (auto-export link)', async () => {
|
||||
const html = await renderViaHTTP(appPort, '/some-amp.amp')
|
||||
expect(html).toMatch(/rel="canonical" href="\/some-amp"/)
|
||||
})
|
||||
|
||||
it('should render correctly when importing isomorphic-unfetch', async () => {
|
||||
const url = `http://localhost:${appPort}/fetch`
|
||||
const res = await fetch(url)
|
||||
|
|
|
@ -117,6 +117,11 @@ describe('Serverless', () => {
|
|||
expect(html).toMatch(/rel="canonical" href="\/some-amp"/)
|
||||
})
|
||||
|
||||
it('should have correct canonical link (auto-export link)', async () => {
|
||||
const html = await renderViaHTTP(appPort, '/some-amp.amp')
|
||||
expect(html).toMatch(/rel="canonical" href="\/some-amp"/)
|
||||
})
|
||||
|
||||
it('should render correctly when importing isomorphic-unfetch', async () => {
|
||||
const url = `http://localhost:${appPort}/fetch`
|
||||
const res = await fetch(url)
|
||||
|
|
Loading…
Reference in a new issue