feat(playwright): integrate Playwright for end-to-end testing and update .gitignore

- Added Playwright as a development dependency for end-to-end testing.
- Updated package.json to include test scripts for Playwright.
- Enhanced .gitignore to exclude Playwright test results and cache files.
- Improved content extraction logic in various components to handle new content types.

Made-with: Cursor
This commit is contained in:
Dorian
2026-03-02 22:02:19 +00:00
parent 5414060225
commit 43ca3a7837
23 changed files with 653 additions and 13 deletions
@@ -74,8 +74,12 @@ defineEmits<{ back: [] }>()
const { isDark } = useTheme()
const articleDomain = computed(() => {
const url = props.article?.url
if (!url || typeof url !== 'string') return ''
try {
return new URL(props.article.url).hostname.replace(/^www\./, '')
const u = new URL(url)
if (!/^https?:$/i.test(u.protocol)) return ''
return u.hostname.replace(/^www\./, '')
} catch {
return ''
}
@@ -1,7 +1,7 @@
<template>
<div class="relative flex-1 flex flex-col min-h-0 overflow-hidden">
<div
v-if="contextType === 'film' || contextType === 'song' || contextType === 'podcast' || contextType === 'websites'"
v-if="['film','song','podcast','news','websites','magazine'].includes(contextType)"
class="flex-1 flex flex-col min-h-0"
>
<div
@@ -75,7 +75,7 @@ import LoadingFilmGrid from './LoadingFilmGrid.vue'
const props = withDefaults(
defineProps<{
contextType?: 'film' | 'song' | 'podcast' | 'websites' | 'generic'
contextType?: 'film' | 'song' | 'podcast' | 'news' | 'websites' | 'magazine' | 'generic'
}>(),
{ contextType: 'film' }
)
@@ -86,7 +86,9 @@ const contextLabel = computed(() => {
if (props.contextType === 'film') return 'Film recommendations'
if (props.contextType === 'song') return 'Song recommendations'
if (props.contextType === 'podcast') return 'Podcast recommendations'
if (props.contextType === 'news') return 'Articles'
if (props.contextType === 'websites') return 'Websites'
if (props.contextType === 'magazine') return 'Brief'
return 'Content'
})
</script>