feat: Inbox list filter (#8880)
* feat: Inbox list filter * fix: routes after delete/unread * fix: Specs * feat: Handle sort in frontend * chore: Minor fixes * chore: Minor fix --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -16,6 +16,32 @@ describe('#getters', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('getFilteredNotifications', () => {
|
||||
const state = {
|
||||
records: {
|
||||
1: { id: 1, read_at: '2024-02-07T11:42:39.988Z', snoozed_until: null },
|
||||
2: { id: 2, read_at: null, snoozed_until: null },
|
||||
3: {
|
||||
id: 3,
|
||||
read_at: '2024-02-07T11:42:39.988Z',
|
||||
snoozed_until: '2024-02-07T11:42:39.988Z',
|
||||
},
|
||||
},
|
||||
};
|
||||
const filters = {
|
||||
type: 'read',
|
||||
status: 'snoozed',
|
||||
sortOrder: 'desc',
|
||||
};
|
||||
expect(getters.getFilteredNotifications(state)(filters)).toEqual([
|
||||
{
|
||||
id: 3,
|
||||
read_at: '2024-02-07T11:42:39.988Z',
|
||||
snoozed_until: '2024-02-07T11:42:39.988Z',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('getUIFlags', () => {
|
||||
const state = {
|
||||
uiFlags: {
|
||||
|
||||
Reference in New Issue
Block a user