mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
[FLASK] disable "Mark all as read button" when there are no notifications (#15333)
* [Flask] disable "Mark all as read button" when there are no notifications * Adding test case * Addressing feedback
This commit is contained in:
parent
e12d0a94e8
commit
c677edc51d
@ -64,9 +64,10 @@ describe('Notifications', () => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const { getByText } = render(mockStore);
|
const { getByText, getByRole } = render(mockStore);
|
||||||
|
|
||||||
expect(getByText('Nothing to see here.')).toBeDefined();
|
expect(getByText('Nothing to see here.')).toBeDefined();
|
||||||
|
expect(getByRole('button', { name: 'Mark all as read' })).toBeDisabled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ export default function Notifications() {
|
|||||||
type="secondary"
|
type="secondary"
|
||||||
className="notifications__header_button"
|
className="notifications__header_button"
|
||||||
onClick={markAllAsRead}
|
onClick={markAllAsRead}
|
||||||
|
disabled={unreadNotifications.length === 0}
|
||||||
>
|
>
|
||||||
{t('notificationsMarkAllAsRead')}
|
{t('notificationsMarkAllAsRead')}
|
||||||
</Button>
|
</Button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user