14 lines
502 B
TypeScript
14 lines
502 B
TypeScript
import { describe, test, expect } from 'vitest';
|
|||
|
|
import { SearchBar } from './SearchBar';
|
||
|
|
|
||
|
|
const toHtml = (SearchBar as any).toHtml;
|
||
|
|
|
||
|
|
describe('SearchBar.toHtml decorative icons (F2.5)', () => {
|
||
|
|
test('the input-adjacent search icon is aria-hidden', () => {
|
||
|
|
const { html } = toHtml({}, '');
|
||
|
|
const icons = html.match(/<i class="fa fa-search"[^>]*>/g) || [];
|
||
|
|
expect(icons.length).toBeGreaterThan(0);
|
||
|
|
icons.forEach((tag: string) => expect(tag).toContain('aria-hidden="true"'));
|
||
|
|
});
|
||
|
|
});
|