import { describe, it, expect, afterEach } from 'vitest';
import { cleanup, render } from 'vitest-browser-svelte';
import { page } from 'vitest/browser';
import AuthHeader from './AuthHeader.svelte';

afterEach(cleanup);

describe('AuthHeader', () => {
	it('renders the brand link to /', async () => {
		render(AuthHeader, { props: {} });

		await expect
			.element(page.getByRole('link', { name: /familienarchiv/i }))
			.toHaveAttribute('href', '/');
	});

	it('renders the brand wordmark', async () => {
		render(AuthHeader, { props: {} });

		await expect.element(page.getByText('Familienarchiv')).toBeVisible();
	});
});
