Major fixes and improvements: - Fixed edit event button functionality with proper event handlers and DOM ready state checking - Added status column to tickets table via Supabase migration to resolve 500 API errors - Updated stats API to correctly calculate revenue from decimal price values - Resolved authentication redirect loops by fixing cookie configuration for Docker environment - Fixed Permissions-Policy header syntax errors - Added comprehensive debugging and error handling for event management - Implemented modal-based event editing with form validation and API integration - Enhanced event data loading with proper error handling and user feedback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.9 KiB
JavaScript
54 lines
1.9 KiB
JavaScript
const { test, expect } = require('@playwright/test');
|
|
|
|
test.describe('Simple Theme Test', () => {
|
|
test('Test theme toggle with onclick', async ({ page }) => {
|
|
// Navigate to the calendar page
|
|
await page.goto('http://localhost:3000/calendar');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
console.log('=== TESTING ONCLICK THEME TOGGLE ===');
|
|
|
|
// Check initial state
|
|
const initialTheme = await page.locator('html').getAttribute('data-theme');
|
|
console.log('Initial theme:', initialTheme);
|
|
|
|
// Check if toggleTheme function exists
|
|
const hasToggleTheme = await page.evaluate(() => {
|
|
return typeof window.toggleTheme === 'function';
|
|
});
|
|
console.log('toggleTheme function exists:', hasToggleTheme);
|
|
|
|
// Try clicking the theme toggle button
|
|
const themeToggle = page.locator('#theme-toggle');
|
|
const toggleExists = await themeToggle.isVisible();
|
|
console.log('Theme toggle visible:', toggleExists);
|
|
|
|
if (toggleExists) {
|
|
// Click the toggle
|
|
await themeToggle.click();
|
|
await page.waitForTimeout(500);
|
|
|
|
// Check new state
|
|
const newTheme = await page.locator('html').getAttribute('data-theme');
|
|
console.log('After click theme:', newTheme);
|
|
|
|
// Check if theme actually changed
|
|
const themeChanged = initialTheme !== newTheme;
|
|
console.log('Theme changed:', themeChanged);
|
|
|
|
// Check localStorage
|
|
const savedTheme = await page.evaluate(() => localStorage.getItem('theme'));
|
|
console.log('Saved theme in localStorage:', savedTheme);
|
|
|
|
// Take screenshot
|
|
await page.screenshot({ path: 'theme-toggle-test.png', fullPage: true });
|
|
|
|
// Try clicking again to toggle back
|
|
await themeToggle.click();
|
|
await page.waitForTimeout(500);
|
|
|
|
const finalTheme = await page.locator('html').getAttribute('data-theme');
|
|
console.log('After second click theme:', finalTheme);
|
|
}
|
|
});
|
|
}); |