Disable static output tests

This commit is contained in:
Sam Carlton 2022-06-11 18:47:37 -05:00
parent a654b89f75
commit 7cc4c04347

View file

@ -160,107 +160,55 @@ test('Sitemap mostly matches production', async (t) => {
t.pass() t.pass()
}) })
test('All Category pages have valid FAQPage structured data', async (t) => {
const categoryUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/kind/') ) // test('All TV pages have valid VideoObject structured data', async (t) => {
// const tvUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/tv/') )
try { // try {
await testStructuredData({ // await testStructuredData({
pageUrls: categoryUrls, // pageUrls: tvUrls,
schemas: [ 'FAQPage' ], // schemas: [ 'VideoObject' ]
presets: [ // })
Google,
// Twitter
],
})
} catch ( error ) { // } catch ( error ) {
console.log('failed', error.failed) // console.log('failed', error.failed)
t.fail( error.message ) // t.fail( error.message )
} // }
t.log( `${categoryUrls.length} valid pages` ) // t.log( `${tvUrls.length} valid pages` )
t.pass() // t.pass()
}) // })
// test('All App pages with bundle data have bundle data visuals', async (t) => {
test('All Device pages have valid FAQPage structured data', async (t) => { // const appUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/app/') )
const deviceUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/device/') ) // const appsWithBundleIds = await fs.readJson('./static/app-list.json', 'utf-8').then( appList => {
// return appList.filter( app => {
// return app.bundleIds.length > 0
// })
// })
// t.log(`${appsWithBundleIds.length} apps with bundle IDs`)
try { // try {
await testStructuredData({ // for ( const app of appsWithBundleIds ) {
pageUrls: deviceUrls, // const hasAppBundlesSection = await pageContains( 'App Bundles', `${ process.env.URL }${app.endpoint}` )
schemas: [ 'FAQPage' ],
presets: [
Google,
// Twitter
],
})
} catch ( error ) { // if ( !hasAppBundlesSection ) throw new Error(`Couldn't find App Bundles section on ${ app.endpoint }`)
console.log('failed', error.failed) // }
t.fail( error.message )
}
t.log( `${deviceUrls.length} valid pages` ) // } catch ( error ) {
t.pass() // console.log('failed', error)
}) // t.fail( error.message )
// }
// t.log( `${appsWithBundleIds.length} valid app pages` )
// t.pass()
test('All TV pages have valid VideoObject structured data', async (t) => { // })
const tvUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/tv/') )
try {
await testStructuredData({
pageUrls: tvUrls,
schemas: [ 'VideoObject' ]
})
} catch ( error ) {
console.log('failed', error.failed)
t.fail( error.message )
}
t.log( `${tvUrls.length} valid pages` )
t.pass()
})
test('All App pages with bundle data have bundle data visuals', async (t) => {
const appUrls = t.context.sitemapUrls.filter( url => url.pathname.startsWith('/app/') )
const appsWithBundleIds = await fs.readJson('./static/app-list.json', 'utf-8').then( appList => {
return appList.filter( app => {
return app.bundleIds.length > 0
})
})
t.log(`${appsWithBundleIds.length} apps with bundle IDs`)
try {
for ( const app of appsWithBundleIds ) {
const hasAppBundlesSection = await pageContains( 'App Bundles', `${ process.env.URL }${app.endpoint}` )
if ( !hasAppBundlesSection ) throw new Error(`Couldn't find App Bundles section on ${ app.endpoint }`)
}
} catch ( error ) {
console.log('failed', error)
t.fail( error.message )
}
t.log( `${appsWithBundleIds.length} valid app pages` )
t.pass()
})