Complete Svelte 5 runes migration and fix remaining ESLint errors: **Svelte 5 Migration (40 errors):** - Add $state() and $state.raw() for reactive variables and DOM refs - Replace deprecated on:event directives with onevent syntax - Fix closure capture issues in derived values - Replace svelte:self with direct component imports - Fix state initialization and reactivity issues **TypeScript/ESLint (8 errors):** - Replace explicit any types with proper types (Prisma.MediaWhereInput, unknown) - Remove unused imports and rename unused variables with underscore prefix - Convert require() to ES6 import syntax **Other Fixes (13 errors):** - Disable custom element props warnings for form components - Fix self-closing textarea tags - Add aria-labels to icon-only buttons - Add keyboard handlers for interactive elements - Refactor map popup to use Svelte component instead of HTML strings Files modified: 28 components, 2 scripts, 1 utility New file: MapPopup.svelte for geolocation popup content
35 lines
988 B
JavaScript
35 lines
988 B
JavaScript
// Simple test to check if project edit page loads correctly
|
|
import puppeteer from 'puppeteer'
|
|
|
|
;(async () => {
|
|
const browser = await puppeteer.launch({ headless: false })
|
|
const page = await browser.newPage()
|
|
|
|
try {
|
|
// Go to admin login first (might be needed)
|
|
await page.goto('http://localhost:5173/admin/login')
|
|
await page.waitForTimeout(1000)
|
|
|
|
// Try to go directly to edit page
|
|
await page.goto('http://localhost:5173/admin/projects/8/edit')
|
|
await page.waitForTimeout(2000)
|
|
|
|
// Check if title field is populated
|
|
const titleValue = await page.$eval(
|
|
'input[placeholder*="title" i], input[name*="title" i], #title',
|
|
(el) => el.value
|
|
)
|
|
|
|
console.log('Title field value:', titleValue)
|
|
|
|
if (titleValue === 'Maitsu') {
|
|
console.log('✅ Form loading works correctly!')
|
|
} else {
|
|
console.log('❌ Form loading failed - title not populated')
|
|
}
|
|
} catch (error) {
|
|
console.error('Test failed:', error.message)
|
|
} finally {
|
|
await browser.close()
|
|
}
|
|
})()
|