File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,9 +84,7 @@ export default defineNuxtModule<ModuleOptions>({
8484 // The meta tag MUST appear before the App Bridge script — it reads the API key on load.
8585 nuxt . hook ( 'app:resolve' , ( ) => {
8686 nuxt . options . app . head = nuxt . options . app . head || { }
87- nuxt . options . app . head . meta = [
88- ...( nuxt . options . app . head . meta || [ ] )
89- ]
87+ nuxt . options . app . head . meta = [ ...( nuxt . options . app . head . meta || [ ] ) ]
9088 nuxt . options . app . head . script = [
9189 // 1. Inline script to create the meta tag imperatively — guarantees it
9290 // exists in the DOM before the CDN script executes.
Original file line number Diff line number Diff line change 11import { createHmac } from 'node:crypto'
22import { fileURLToPath } from 'node:url'
33import { describe , it , expect } from 'vitest'
4- import { setup , $fetch } from '@nuxt/test-utils/e2e'
4+ import { setup , $fetch , url } from '@nuxt/test-utils/e2e'
55
66const TEST_API_KEY = 'test-api-key'
77const TEST_API_SECRET = 'test-api-secret'
@@ -44,9 +44,10 @@ describe('shopify-nuxt module', async () => {
4444 expect ( html ) . toContain ( 'cdn.shopify.com/shopifycloud/polaris' )
4545 } )
4646
47- it ( 'includes CSP frame-ancestors meta tag' , async ( ) => {
48- const html = await $fetch ( '/' )
49- expect ( html ) . toContain ( 'frame-ancestors' )
47+ it ( 'includes CSP frame-ancestors header' , async ( ) => {
48+ const res = await fetch ( url ( '/' ) )
49+ const csp = res . headers . get ( 'content-security-policy' )
50+ expect ( csp ) . toContain ( 'frame-ancestors' )
5051 } )
5152 } )
5253
You can’t perform that action at this time.
0 commit comments