test: test case is added to Favourites

This commit is contained in:
tzhangchi
2022-12-24 23:07:19 +08:00
parent c2c272b3fe
commit 45e28d3dad
3 changed files with 119 additions and 2 deletions
@@ -44,7 +44,11 @@ const FavoriteTag = ({
toast(!favorite ? 'Removed to Favourites' : 'Added to Favourites');
}}
>
{favorite ? <FavouritedIcon /> : <FavouritesIcon />}
{favorite ? (
<FavouritedIcon data-testid="favourited-icon" />
) : (
<FavouritesIcon />
)}
</IconButton>
</Tooltip>
);
@@ -43,6 +43,7 @@ const FavoriteList = ({ showList }: { showList: boolean }) => {
const active = router.query.pageId === pageMeta.id;
return (
<StyledSubListItem
data-testid={`favorite-list-item-${pageMeta.id}`}
active={active}
key={`${pageMeta}-${index}`}
onClick={() => {