import { render, screen } from '@test-utils';
import List, { type ListItem } from './list';

const items: ListItem[] = [
  { id: 'item-1', value: 'Item 1' },
  { id: 'item-2', value: 'Item 2' },
  {
    child: [
      { id: 'nested-item-1', value: 'Nested item 1' },
      { id: 'nested-item-2', value: 'Nested item 2' },
    ],
    id: 'item-3',
    value: 'Item 3',
  },
  { id: 'item-4', value: 'Item 4' },
];

describe('List', () => {
  it('renders a nested unordered list', () => {
    render(<List items={items} />);
    const listItems = screen.getAllByRole('list');
    listItems.forEach((listItem) =>
      expect(listItem).toHaveClass('list--unordered')
    );
  });
});
git'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='/cgit-data/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/www.armandphilippot.com/'>www.armandphilippot.com</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='15178f18b83d96073060d44e114a707919028546'/><select name='h' onchange='this.form.submit();'>
<option value='main'>main</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>The frontend of my personal website.</td><td class='sub right'>Armand Philippot</td></tr></table>
<table class='tabs'><tr><td>
<a href='/www.armandphilippot.com/?h=v1.0.0'>summary</a><a href='/www.armandphilippot.com/refs/?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>refs</a><a href='/www.armandphilippot.com/log/src/components/Icons/Arrow/Arrow.module.scss?h=v1.0.0'>log</a><a class='active' href='/www.armandphilippot.com/tree/src/components/Icons/Arrow/Arrow.module.scss?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>tree</a><a href='/www.armandphilippot.com/commit/src/components/Icons/Arrow/Arrow.module.scss?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>commit</a><a href='/www.armandphilippot.com/diff/src/components/Icons/Arrow/Arrow.module.scss?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>diff</a><a href='/www.armandphilippot.com/stats/src/components/Icons/Arrow/Arrow.module.scss?h=v1.0.0'>stats</a></td><td class='form'><form class='right' method='get' action='/www.armandphilippot.com/log/src/components/Icons/Arrow/Arrow.module.scss'>
<input type='hidden' name='h' value='v1.0.0'/><input type='hidden' name='id' value='15178f18b83d96073060d44e114a707919028546'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/www.armandphilippot.com/tree/?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>root</a>/<a href='/www.armandphilippot.com/tree/src?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>src</a>/<a href='/www.armandphilippot.com/tree/src/components?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>components</a>/<a href='/www.armandphilippot.com/tree/src/components/Icons?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>Icons</a>/<a href='/www.armandphilippot.com/tree/src/components/Icons/Arrow?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>Arrow</a>/<a href='/www.armandphilippot.com/tree/src/components/Icons/Arrow/Arrow.module.scss?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>Arrow.module.scss</a></div><div class='content'>blob: 49e9b02e5a3bf3aa48092a88f5941b307bd2c419 (<a href='/www.armandphilippot.com/plain/src/components/Icons/Arrow/Arrow.module.scss?h=v1.0.0&amp;id=15178f18b83d96073060d44e114a707919028546'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
</pre></td>
<td class='lines'><pre><code>