Simplify column headers (#27557)
This commit is contained in:
parent
1f5187e2e2
commit
13d310e64d
13 changed files with 113 additions and 125 deletions
|
@ -1,13 +1,15 @@
|
|||
import { render, fireEvent, screen } from '@testing-library/react';
|
||||
import { render, fireEvent, screen } from 'mastodon/test_helpers';
|
||||
|
||||
import Column from '../column';
|
||||
|
||||
const fakeIcon = () => <span />;
|
||||
|
||||
describe('<Column />', () => {
|
||||
describe('<ColumnHeader /> click handler', () => {
|
||||
it('runs the scroll animation if the column contains scrollable content', () => {
|
||||
const scrollToMock = jest.fn();
|
||||
const { container } = render(
|
||||
<Column heading='notifications'>
|
||||
<Column heading='notifications' icon='notifications' iconComponent={fakeIcon}>
|
||||
<div className='scrollable' />
|
||||
</Column>,
|
||||
);
|
||||
|
@ -17,7 +19,7 @@ describe('<Column />', () => {
|
|||
});
|
||||
|
||||
it('does not try to scroll if there is no scrollable content', () => {
|
||||
render(<Column heading='notifications' />);
|
||||
render(<Column heading='notifications' icon='notifications' iconComponent={fakeIcon} />);
|
||||
fireEvent.click(screen.getByText('notifications'));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue