import { test, expect } from '@playwright/test';

test.describe('Curator Dashboard', () => {
    test('Curator login form should be displayed', async ({ page }) => {
        await page.goto('/en/curator');
        // Check for login form elements
        await expect(page.getByPlaceholder('Username')).toBeVisible();
        await expect(page.getByPlaceholder('Password')).toBeVisible();
        await expect(page.getByRole('button', { name: 'Log in' })).toBeVisible();
    });

    // Valid login cannot be tested without seed data in this environment
    test('Curator login attempt (invalid credentials)', async ({ page }) => {
        await page.goto('/en/curator');

        await page.getByPlaceholder('Username').fill('invalid_user');
        await page.getByPlaceholder('Password').fill('invalid_pass');
        await page.getByRole('button', { name: 'Log in' }).click({ force: true });

        // Should show error message
        await expect(page.getByText('Login failed')).toBeVisible();
    });
});
