listitem = await screen.findByRole('listitem', { current: true });
expect(within(listitem).getByRole('link', { name: 'Awsome java rule' })).toBeInTheDocument();
await user.keyboard('{ArrowRight}');
- expect(screen.getByRole('heading', { level: 3, name: 'Awsome java rule' })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { level: 1, name: 'Awsome java rule' })).toBeInTheDocument();
await user.keyboard('{ArrowLeft}');
listitem = await screen.findByRole('listitem', { current: true });
expect(within(listitem).getByRole('link', { name: 'Awsome java rule' })).toBeInTheDocument();
it('should show open rule with default description section', async () => {
renderCodingRulesApp(undefined, 'coding_rules?open=rule1');
expect(
- await screen.findByRole('heading', { level: 3, name: 'Awsome java rule' })
+ await screen.findByRole('heading', { level: 1, name: 'Awsome java rule' })
).toBeInTheDocument();
expect(document.title).toEqual('coding_rule.page.Java.Awsome java rule');
expect(screen.getByText('Why')).toBeInTheDocument();
it('should show open rule with no description', async () => {
renderCodingRulesApp(undefined, 'coding_rules?open=rule6');
expect(
- await screen.findByRole('heading', { level: 3, name: 'Bad Python rule' })
+ await screen.findByRole('heading', { level: 1, name: 'Bad Python rule' })
).toBeInTheDocument();
expect(screen.getByText('issue.external_issue_description.Bad Python rule')).toBeInTheDocument();
});
it('should show hotspot rule section', async () => {
const user = userEvent.setup();
renderCodingRulesApp(undefined, 'coding_rules?open=rule2');
- expect(await screen.findByRole('heading', { level: 3, name: 'Hot hotspot' })).toBeInTheDocument();
+ expect(await screen.findByRole('heading', { level: 1, name: 'Hot hotspot' })).toBeInTheDocument();
expect(screen.getByText('Introduction to this rule')).toBeInTheDocument();
expect(
screen.getByRole('tab', {
const user = userEvent.setup();
renderCodingRulesApp(undefined, 'coding_rules?open=rule5');
expect(
- await screen.findByRole('heading', { level: 3, name: 'Awsome Python rule' })
+ await screen.findByRole('heading', { level: 1, name: 'Awsome Python rule' })
).toBeInTheDocument();
expect(screen.getByText('Introduction to this rule')).toBeInTheDocument();
expect(
const user = userEvent.setup();
renderCodingRulesApp(undefined, 'coding_rules?open=rule7');
expect(
- await screen.findByRole('heading', { level: 3, name: 'Python rule with context' })
+ await screen.findByRole('heading', { level: 1, name: 'Python rule with context' })
).toBeInTheDocument();
expect(
screen.getByRole('tab', {
handler.setIsAdmin();
renderCodingRulesApp(undefined, 'coding_rules?open=rule5');
expect(
- await screen.findByRole('heading', { level: 3, name: 'Awsome Python rule' })
+ await screen.findByRole('heading', { level: 1, name: 'Awsome Python rule' })
).toBeInTheDocument();
// Add
const user = userEvent.setup();
renderCodingRulesApp(mockLoggedInUser(), 'coding_rules?open=rule8');
await screen.findByRole('heading', {
- level: 3,
+ level: 1,
name: 'Awesome Python rule with education principles',
});
expect(
renderCodingRulesApp(mockLoggedInUser(), 'coding_rules?open=rule8');
await screen.findByRole('heading', {
- level: 3,
+ level: 1,
name: 'Awesome Python rule with education principles',
});
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import classNames from 'classnames';
import * as React from 'react';
import { Button, ButtonLink } from '../../components/controls/buttons';
import HelpTooltip from '../../components/controls/HelpTooltip';
name
);
return (
- <div className="search-navigator-facet-header-wrapper display-flex-center">
+ <div
+ className={classNames('search-navigator-facet-header-wrapper display-flex-center', {
+ 'expandable-header': this.props.onClick,
+ })}
+ >
{this.props.onClick ? (
<span className="search-navigator-facet-header display-flex-center">
<button