mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
fix to use https urls in meta data images when using experimental-https (#80276)
fixes #80275 .. to generate https image urls in meta data when using the --experimental-https flag --------- Co-authored-by: Zack Tanner <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
This commit is contained in:
co-authored by
Zack Tanner
JJ Kasper
parent
354c7d2c4d
commit
72cc7db1bd
@@ -0,0 +1,30 @@
|
||||
import { nextTestSetup } from 'e2e-utils'
|
||||
import { shouldRunTurboDevTest } from 'next-test-utils'
|
||||
|
||||
describe('experimental-https-server OpenGraph image', () => {
|
||||
const { next, skipped } = nextTestSetup({
|
||||
files: __dirname,
|
||||
startCommand: `pnpm next ${
|
||||
shouldRunTurboDevTest() ? 'dev --turbo' : 'dev'
|
||||
} --experimental-https`,
|
||||
skipStart: !process.env.NEXT_TEST_CI,
|
||||
})
|
||||
if (skipped) return
|
||||
|
||||
if (!process.env.NEXT_TEST_CI) {
|
||||
console.warn('only runs on CI as it requires administrator privileges')
|
||||
it('only runs on CI as it requires administrator privileges', () => {})
|
||||
return
|
||||
}
|
||||
|
||||
it('should generate https:// URLs for OpenGraph images when experimental HTTPS is enabled', async () => {
|
||||
expect(next.url).toContain('https://')
|
||||
const browser = await next.browser('/1', {
|
||||
ignoreHTTPSErrors: true,
|
||||
})
|
||||
const html = await browser.eval('document.documentElement.innerHTML')
|
||||
expect(html).toContain('Hello from App')
|
||||
expect(html).toMatch(/<meta property="og:image" content="https:\/\//)
|
||||
expect(html).toMatch(/<meta name="twitter:image" content="https:\/\//)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user