Skip to content

Commit

Permalink
feat(scheduling): MC-1273, MC-1274 Add 'ML-Scheduled' to filters and …
Browse files Browse the repository at this point in the history
…scheduled item card (#1208)

* feat(scheduling): MC-1273, MC-1274 Add 'ML-Scheduled' to filters and card

* Revert changes to heading and exclude syndicated items from ML filter
  • Loading branch information
nina-py authored Jul 10, 2024
1 parent fa15939 commit 38234af
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ describe('The CorpusItemCardImage component', () => {
expect(screen.getByText(/syndicated/i)).toBeInTheDocument();
});

it('should render ML-syndicated label if item is both ML-scheduled and syndicated', () => {
const syndicatedItem = { ...item, isSyndicated: true };

render(
<CorpusItemCardImage
item={syndicatedItem}
isMlScheduled={true}
currentScheduledDate={currentScheduledDate}
scheduledSurfaceGuid="NEW_TAB_EN_US"
toggleScheduleHistoryModal={toggleScheduleHistoryModal}
/>,
);

expect(screen.getByText(/ML-syndicated/i)).toBeInTheDocument();
});

it('should render last scheduled label if item has this prop', () => {
item = {
...item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const getTopRightLabel = (
return (
<>
<AutoFixHighOutlinedIcon fontSize="small" />
<Typography variant="caption">ML</Typography>
<Typography variant="caption">
{item.isSyndicated ? 'ML-Syndicated' : 'ML'}
</Typography>
</>
);
}
Expand Down
Loading

0 comments on commit 38234af

Please sign in to comment.