@@ -112,6 +112,59 @@ describe('pages', () => {
112112 expect ( webpageNode . url ) . toEqual ( 'https://example.com/title-override' )
113113 expect ( webpageNode . name ) . toEqual ( 'Title Override' )
114114
115- await expectNoClientErrors ( '/' )
115+ await expectNoClientErrors ( '/title-override' )
116+ } )
117+
118+ it ( 'render plugin override' , async ( ) => {
119+ const schema = await $fetchSchemaOrg ( '/plugin-override' )
120+
121+ // Snapshot
122+ expect ( schema ) . toMatchInlineSnapshot ( `
123+ {
124+ "@context": "https://schema.org",
125+ "@graph": [
126+ {
127+ "@id": "https://override-example.com/#identity",
128+ "@type": "Person",
129+ "jobTitle": "Software Engineer",
130+ "name": "Harlan",
131+ "url": "https://override-example.com",
132+ },
133+ {
134+ "@id": "https://override-example.com/#website",
135+ "@type": "WebSite",
136+ "name": "My Website",
137+ "publisher": {
138+ "@id": "https://override-example.com/#identity",
139+ },
140+ "url": "https://override-example.com",
141+ },
142+ {
143+ "@id": "https://override-example.com/plugin-override/#webpage",
144+ "@type": "WebPage",
145+ "about": {
146+ "@id": "https://override-example.com/#identity",
147+ },
148+ "isPartOf": {
149+ "@id": "https://override-example.com/#website",
150+ },
151+ "potentialAction": [
152+ {
153+ "@type": "ReadAction",
154+ "target": [
155+ "https://override-example.com/plugin-override",
156+ ],
157+ },
158+ ],
159+ "url": "https://override-example.com/plugin-override",
160+ },
161+ ],
162+ }
163+ ` )
164+
165+ const webpageNode = schema [ '@graph' ] . filter ( n => n [ '@type' ] === 'WebPage' ) [ 0 ]
166+ expect ( webpageNode . url ) . toEqual ( 'https://override-example.com/plugin-override' )
167+
168+ await expectNoClientErrors ( '/plugin-override' )
116169 } )
117170} )
0 commit comments