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

afterEach(() => cleanup());

describe('GlyphLabel', () => {
	it('renders the glyph aria-hidden with an sr-only label sibling', () => {
		render(GlyphLabel, { glyph: '✉', label: 'Brief' });
		const hidden = document.querySelector('[aria-hidden="true"]');
		expect(hidden?.textContent).toBe('✉');
		const srOnly = document.querySelector('.sr-only');
		expect(srOnly?.textContent).toBe('Brief');
	});
});
