import { render, screen } from '@test-utils';
import CommentForm from './comment-form';

const saveComment = async () => {
  /** Do nothing. */
};
const title = 'Cum voluptas voluptatibus';

describe('CommentForm', () => {
  it('renders a form', () => {
    render(<CommentForm saveComment={saveComment} />);
    expect(screen.getByRole('form')).toBeInTheDocument();
  });

  it('renders an optional title', () => {
    render(
      <CommentForm saveComment={saveComment} title={title} titleLevel={2} />
    );
    expect(
      screen.getByRole('heading', { level: 2, name: title })
    ).toBeInTheDocument();
  });
});
om' title='www.armandphilippot.com Git repository'/>
</head>
<body>
<div id='cgit'><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='8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'/><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=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>refs</a><a href='/www.armandphilippot.com/log/src/components/WidgetParts/OrderedList/OrderedList.tsx?h=v1.0.0'>log</a><a class='active' href='/www.armandphilippot.com/tree/src/components/WidgetParts/OrderedList/OrderedList.tsx?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>tree</a><a href='/www.armandphilippot.com/commit/src/components/WidgetParts/OrderedList/OrderedList.tsx?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>commit</a><a href='/www.armandphilippot.com/diff/src/components/WidgetParts/OrderedList/OrderedList.tsx?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>diff</a><a href='/www.armandphilippot.com/stats/src/components/WidgetParts/OrderedList/OrderedList.tsx?h=v1.0.0'>stats</a></td><td class='form'><form class='right' method='get' action='/www.armandphilippot.com/log/src/components/WidgetParts/OrderedList/OrderedList.tsx'>
<input type='hidden' name='h' value='v1.0.0'/><input type='hidden' name='id' value='8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'/><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=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>root</a>/<a href='/www.armandphilippot.com/tree/src?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>src</a>/<a href='/www.armandphilippot.com/tree/src/components?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>components</a>/<a href='/www.armandphilippot.com/tree/src/components/WidgetParts?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>WidgetParts</a>/<a href='/www.armandphilippot.com/tree/src/components/WidgetParts/OrderedList?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>OrderedList</a>/<a href='/www.armandphilippot.com/tree/src/components/WidgetParts/OrderedList/OrderedList.tsx?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>OrderedList.tsx</a></div><div class='content'>blob: a12ec06de842c1d6e3f74eaca7d67221830ff11a (<a href='/www.armandphilippot.com/plain/src/components/WidgetParts/OrderedList/OrderedList.tsx?h=v1.0.0&amp;id=8a6f09b564d5d2f02d0a2605f6b52070a910aaa3'>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>