Erste Abarbeitung des Repository-Audits (siehe TODO.md). Sicherheit: - Rate-Limiting für alle vier Auth-Endpunkte. Sie waren unbegrenzt aufrufbar, also beliebig viele Mails über den eigenen SMTP-Zugang und beliebig viele Rateversuche auf Verifizierungscodes. - Passwort-Reset-Token nur noch als SHA-256-Hash in der Datenbank. Bisher Klartext: Lesezugriff auf die DB genuegte zur Kontouebernahme. - Tote Mock-Login-Route entfernt. Sie verglich gegen ein hartcodiertes Fake-Passwort und war ueber die Middleware-Ausnahme fuer /api/auth/* ohne Anmeldung erreichbar. - Passwort-Reset auf bcrypt-Kosten 12, wie beim Signup. Reparaturen: - npm test rief jest auf, obwohl es weder Jest-Config noch Jest-Tests gibt. Zeigt jetzt auf Playwright; jest/ts-jest/@types/jest entfernt. - Falscher sonar.projectKey im Workflow. Verifiziert per tsc gegen die geaenderten Bereiche: keine neuen Typfehler. v1.117.0 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
// Test to verify CSS styling is working in your application
|
|
test.describe('CSS Debugging Tests', () => {
|
|
test('should load with proper CSS styling', async ({ page }) => {
|
|
await page.goto('http://localhost:3001');
|
|
|
|
// Verify main page elements have proper styling
|
|
const mainHeader = page.getByText('My Weekly To Do List');
|
|
await expect(mainHeader).toBeVisible();
|
|
|
|
// Check for CSS classes that indicate styling is applied
|
|
const taskItem = page.locator('.task-item');
|
|
await expect(taskItem).toBeVisible();
|
|
|
|
// Verify basic CSS properties are applied
|
|
const taskItemStyles = await taskItem.evaluate(element => {
|
|
const computedStyle = window.getComputedStyle(element);
|
|
return {
|
|
backgroundColor: computedStyle.backgroundColor,
|
|
borderRadius: computedStyle.borderRadius,
|
|
boxShadow: computedStyle.boxShadow
|
|
};
|
|
});
|
|
|
|
console.log('Task item CSS properties:', taskItemStyles);
|
|
expect(taskItemStyles.backgroundColor).toBeTruthy();
|
|
});
|
|
|
|
test('should have proper auth form styling', async ({ page }) => {
|
|
await page.goto('http://localhost:3001/auth/login');
|
|
|
|
// Check that auth form has proper styling
|
|
const authForm = page.locator('.auth-form');
|
|
await expect(authForm).toBeVisible();
|
|
|
|
// Verify CSS properties on auth form
|
|
const formStyles = await authForm.evaluate(element => {
|
|
const computedStyle = window.getComputedStyle(element);
|
|
return {
|
|
backgroundColor: computedStyle.backgroundColor,
|
|
borderRadius: computedStyle.borderRadius,
|
|
boxShadow: computedStyle.boxShadow
|
|
};
|
|
});
|
|
|
|
console.log('Auth form CSS properties:', formStyles);
|
|
expect(formStyles.backgroundColor).toBeTruthy();
|
|
});
|
|
}); |