Skip to content

Commit

Permalink
Reintroduce book info in Favorites and Deleted pages
Browse files Browse the repository at this point in the history
  • Loading branch information
karlosos committed Nov 21, 2023
1 parent 9fa16a0 commit 1fbb6ab
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/app/__tests__/App.test.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
screen,
waitFor,
} from '@testing-library/react';
import { screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';

Expand Down Expand Up @@ -40,7 +37,10 @@ test('Clear all data', async () => {
expect(screen.queryByText('Mitologia')).not.toBeInTheDocument();
});
// go back to dashboard page
await userEvent.click(screen.getByText(/dashboard/i), leftClick);
await userEvent.click(
within(screen.getByRole('menu')).getByText(/books/i),
leftClick,
);
expect(screen.queryByText(/Chłopi/i)).not.toBeInTheDocument();
expect(screen.queryByText('Mitologia')).not.toBeInTheDocument();
});
Expand Down
4 changes: 2 additions & 2 deletions src/app/features/clippings/highlights/HighlightsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Pagination } from 'semantic-ui-react';
import HighlightItem from './HighlightItem';
import { Content, Footer, MainHeader, Title, Wrapper } from './HighlightsList.style';

const HighlightsList = ({ title, highlights, isBookView }) => {
const HighlightsList = ({ title, highlights, bookInfoVisible }) => {
const [activePage, setActivePage] = useState(1);
const wrapperRef = useRef();

Expand Down Expand Up @@ -33,7 +33,7 @@ const HighlightsList = ({ title, highlights, isBookView }) => {
<HighlightItem
key={highlightInfo.id}
highlightInfo={highlightInfo}
isBookInfoVisible={isBookView}
isBookInfoVisible={bookInfoVisible}
/>
))}
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const DeletedPage = () => {
deleted: q[1].deleted,
}));

return <HighlightsList title="Deleted" highlights={highlights} />;
return <HighlightsList title="Deleted" highlights={highlights} bookInfoVisible />;
};

export default DeletedPage;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const FavouritesPage = () => {
deleted: q[1].deleted,
}));

return <HighlightsList title="Favourites" highlights={highlights} />;
return <HighlightsList title="Favourites" highlights={highlights} bookInfoVisible />;
};

export default FavouritesPage;
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const HighlightsPage = () => {
<HighlightsList
title={bookTitle ?? 'All highlights'}
highlights={highlights}
isBookView={!bookTitle}
bookInfoVisible={!bookTitle}
/>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout/sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Sidebar = () => {
dispatch(setActiveSidebarItem(name));

return (
<MenuStyled vertical>
<MenuStyled vertical role='menu'>
<Menu.Item>
<Menu.Menu>
<Link to="/">
Expand Down

0 comments on commit 1fbb6ab

Please sign in to comment.