fix tests, removed one unused function, fix real problem that tests helped to

surface
This commit is contained in:
Henry Jameson 2019-01-11 03:38:23 +03:00
parent 48e811e6ed
commit b18e27c6d4
5 changed files with 62 additions and 81 deletions

View file

@ -11,7 +11,7 @@ export const visibleTypes = store => ([
export const visibleNotificationsFromStore = store => {
// map is just to clone the array since sort mutates it and it causes some issues
let sortedNotifications = notificationsFromStore(store).map(_ => _).sort((a, b) => a.id > b.id ? -1 : 1)
let sortedNotifications = notificationsFromStore(store).map(_ => _).sort((a, b) => a.action.id > b.action.id ? -1 : 1)
sortedNotifications = sortBy(sortedNotifications, 'seen')
return sortedNotifications.filter((notification) => visibleTypes(store).includes(notification.type))
}