Enable Video Structured Data on benchmark pages

This commit is contained in:
Sam Carlton 2022-07-06 23:52:55 -05:00
parent c1b232a291
commit da7ae98d5c
3 changed files with 42 additions and 7 deletions

View file

@ -40,7 +40,7 @@ const listingsCases = {
endpoint: '/app/expressvpn/benchmarks/',
apiEndpointPath: '/api/app/expressvpn.json',
expectInitialVideo: true,
shouldHaveVideoStucturedData: false
shouldHaveVideoStucturedData: true
},
// Express VPN Benchmarks
@ -193,11 +193,21 @@ test( 'Listings with videos have structured data', async t => {
for ( const [ caseEndpoint, listingCase ] of listingCaseEntries ) {
const listingDetails = listingsDetails[ caseEndpoint ]
const listingPageHead = new PageHead( {
...listingDetails.headOptions,
pathname: caseEndpoint
})
// Stop here if we're not expecting Video Structured Data
if ( !listingCase.shouldHaveVideoStucturedData ) continue
if ( !listingCase.shouldHaveVideoStucturedData ) {
// Check that the non-video listing doesn't have video structured data
t.assert( !listingPageHead.structuredDataMarkup.includes('VideoObject'), `${ caseEndpoint } has video structured data` )
continue
}
const listingPageHead = new PageHead( listingDetails.headOptions )
// t.log('listingDetails.initialVideo', listingDetails.initialVideo)
// t.log( 'caseEndpoint', caseEndpoint )