Merge branch 'setttingssync' into shigusegubu-themes3
This commit is contained in:
commit
ab7fb1ba51
4 changed files with 138 additions and 146 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
import { showDesktopNotification } from '../desktop_notification_utils/desktop_notification_utils.js'
|
import { showDesktopNotification } from '../desktop_notification_utils/desktop_notification_utils.js'
|
||||||
import { muteFilterHits } from '../status_parser/status_parser.js'
|
import { muteFilterHits } from '../status_parser/status_parser.js'
|
||||||
|
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
import { useAnnouncementsStore } from 'src/stores/announcements.js'
|
||||||
import { useI18nStore } from 'src/stores/i18n.js'
|
import { useI18nStore } from 'src/stores/i18n.js'
|
||||||
|
|
||||||
import FaviconService from 'src/services/favicon_service/favicon_service.js'
|
import FaviconService from 'src/services/favicon_service/favicon_service.js'
|
||||||
|
|
@ -100,14 +101,14 @@ export const filteredNotificationsFromStore = (
|
||||||
.map((_) => _)
|
.map((_) => _)
|
||||||
.sort(sortById)
|
.sort(sortById)
|
||||||
// TODO implement sorting elsewhere and make it optional
|
// TODO implement sorting elsewhere and make it optional
|
||||||
|
console.log(types, visibleTypes(notificationVisibility))
|
||||||
return sortedNotifications.filter((notification) =>
|
return sortedNotifications.filter((notification) =>
|
||||||
(types || visibleTypes(notificationVisibility)).includes(notification.type),
|
(types || visibleTypes(notificationVisibility)).includes(notification.type),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const unseenNotificationsFromStore = (store, notificationVisibility) => {
|
export const unseenNotificationsFromStore = (store, notificationVisibility) => {
|
||||||
const rootGetters = store.rootGetters || store.getters
|
const ignoreInactionableSeen = useSyncConfigStore().mergedConfig.ignoreInactionableSeen
|
||||||
const ignoreInactionableSeen = rootGetters.mergedConfig.ignoreInactionableSeen
|
|
||||||
|
|
||||||
return filteredNotificationsFromStore(store, notificationVisibility).filter(
|
return filteredNotificationsFromStore(store, notificationVisibility).filter(
|
||||||
({ seen, type }) => {
|
({ seen, type }) => {
|
||||||
|
|
@ -188,10 +189,7 @@ export const prepareNotificationObject = (notification, i18n) => {
|
||||||
return notifObj
|
return notifObj
|
||||||
}
|
}
|
||||||
|
|
||||||
export const countExtraNotifications = (store) => {
|
export const countExtraNotifications = (mergedConfig) => {
|
||||||
const rootGetters = store.rootGetters || store.getters
|
|
||||||
const mergedConfig = rootGetters.mergedConfig
|
|
||||||
|
|
||||||
if (!mergedConfig.showExtraNotifications) {
|
if (!mergedConfig.showExtraNotifications) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,57 +21,57 @@ describe('Gallery', () => {
|
||||||
|
|
||||||
it('one audio attachment', () => {
|
it('one audio attachment', () => {
|
||||||
local = {
|
local = {
|
||||||
attachments: [{ mimetype: 'audio/mpeg' }],
|
attachments: [{ type: 'audio' }],
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('one image attachment', () => {
|
it('one image attachment', () => {
|
||||||
local = {
|
local = {
|
||||||
attachments: [{ mimetype: 'image/png' }],
|
attachments: [{ type: 'image' }],
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ items: [{ mimetype: 'image/png' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('one audio attachment and one image attachment', () => {
|
it('one audio attachment and one image attachment', () => {
|
||||||
local = {
|
local = {
|
||||||
attachments: [{ mimetype: 'audio/mpeg' }, { mimetype: 'image/png' }],
|
attachments: [{ type: 'audio' }, { type: 'image' }],
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
{ items: [{ mimetype: 'image/png' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('has "size" key set to "hide"', () => {
|
it('has "size" key set to "hide"', () => {
|
||||||
let local
|
let local
|
||||||
local = {
|
local = {
|
||||||
attachments: [{ mimetype: 'audio/mpeg' }],
|
attachments: [{ type: 'audio' }],
|
||||||
size: 'hide',
|
size: 'hide',
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ minimal: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ minimal: true, items: [{ type: 'audio' }] },
|
||||||
])
|
])
|
||||||
|
|
||||||
local = {
|
local = {
|
||||||
attachments: [
|
attachments: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
size: 'hide',
|
size: 'hide',
|
||||||
}
|
}
|
||||||
|
|
@ -79,186 +79,186 @@ describe('Gallery', () => {
|
||||||
// When defining `size: hide`, the `items` aren't
|
// When defining `size: hide`, the `items` aren't
|
||||||
// grouped and `audio` isn't set
|
// grouped and `audio` isn't set
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ minimal: true, items: [{ mimetype: 'image/jpg' }] },
|
{ minimal: true, items: [{ type: 'image' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'image/png' }] },
|
{ minimal: true, items: [{ type: 'image' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'image/jpg' }] },
|
{ minimal: true, items: [{ type: 'image' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ minimal: true, items: [{ type: 'audio' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'image/png' }] },
|
{ minimal: true, items: [{ type: 'image' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ minimal: true, items: [{ type: 'audio' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'image/jpg' }] },
|
{ minimal: true, items: [{ type: 'image' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'image/png' }] },
|
{ minimal: true, items: [{ type: 'image' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'image/jpg' }] },
|
{ minimal: true, items: [{ type: 'image' }] },
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
// types other than image or audio should be `minimal`
|
// types other than image or audio should be `minimal`
|
||||||
it('non-image/audio', () => {
|
it('non-image', () => {
|
||||||
let local
|
let local
|
||||||
local = {
|
local = {
|
||||||
attachments: [{ mimetype: 'plain/text' }],
|
attachments: [{ type: 'plain' }],
|
||||||
}
|
}
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ minimal: true, items: [{ mimetype: 'plain/text' }] },
|
{ minimal: true, items: [{ type: 'plain' }] },
|
||||||
])
|
])
|
||||||
|
|
||||||
// No grouping of non-image/audio items
|
// No grouping of non-image items
|
||||||
local = {
|
local = {
|
||||||
attachments: [
|
attachments: [
|
||||||
{ mimetype: 'plain/text' },
|
{ type: 'plain' },
|
||||||
{ mimetype: 'plain/text' },
|
{ type: 'plain' },
|
||||||
{ mimetype: 'plain/text' },
|
{ type: 'plain' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ minimal: true, items: [{ mimetype: 'plain/text' }] },
|
{ minimal: true, items: [{ type: 'plain' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'plain/text' }] },
|
{ minimal: true, items: [{ type: 'plain' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'plain/text' }] },
|
{ minimal: true, items: [{ type: 'plain' }] },
|
||||||
])
|
])
|
||||||
|
|
||||||
local = {
|
local = {
|
||||||
attachments: [
|
attachments: [
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'plain/text' },
|
{ type: 'plain' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
// NOTE / TODO: When defining `size: hide`, the `items` aren't
|
// NOTE / TODO: When defining `size: hide`, the `items` aren't
|
||||||
// grouped and `audio` isn't set
|
// grouped and `audio` isn't set
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ items: [{ mimetype: 'image/png' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
{ minimal: true, items: [{ mimetype: 'plain/text' }] },
|
{ minimal: true, items: [{ type: 'plain' }] },
|
||||||
{ items: [{ mimetype: 'image/jpg' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('mixed attachments', () => {
|
it('mixed attachments', () => {
|
||||||
local = {
|
local = {
|
||||||
attachments: [
|
attachments: [
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
{ items: [{ mimetype: 'image/png' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
local = {
|
local = {
|
||||||
attachments: [
|
attachments: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ items: [{ mimetype: 'image/jpg' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
{ items: [{ mimetype: 'image/png' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
])
|
])
|
||||||
|
|
||||||
local = {
|
local = {
|
||||||
attachments: [
|
attachments: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
// Group by three-per-row, unless there's one dangling, then stick it on the end of the last row
|
// Group by three-per-row, unless there's one dangling, then stick it on the end of the last row
|
||||||
// https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1785#note_98514
|
// https:/.pleroma.social-fe/-_requests#note_98514
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
local = {
|
local = {
|
||||||
attachments: [
|
attachments: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ items: [{ mimetype: 'image/jpg' }, { mimetype: 'image/png' }] },
|
{ items: [{ type: 'image' }, { type: 'image' }] },
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('does not do grouping when grid is set', () => {
|
it('does not do grouping when grid is set', () => {
|
||||||
const attachments = [
|
const attachments = [
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
]
|
]
|
||||||
|
|
||||||
local = { grid: true, attachments }
|
local = { grid: true, attachments }
|
||||||
|
|
@ -270,34 +270,34 @@ describe('Gallery', () => {
|
||||||
|
|
||||||
it('limit is set', () => {
|
it('limit is set', () => {
|
||||||
const attachments = [
|
const attachments = [
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/png' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
{ mimetype: 'audio/mpeg' },
|
{ type: 'audio' },
|
||||||
{ mimetype: 'image/jpg' },
|
{ type: 'image' },
|
||||||
]
|
]
|
||||||
|
|
||||||
let local
|
let local
|
||||||
local = { attachments, limit: 2 }
|
local = { attachments, limit: 2 }
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
{ items: [{ mimetype: 'image/png' }] },
|
{ items: [{ type: 'image' }] },
|
||||||
])
|
])
|
||||||
|
|
||||||
local = { attachments, limit: 3 }
|
local = { attachments, limit: 3 }
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
{ items: [{ mimetype: 'image/png' }, { mimetype: 'image/jpg' }] },
|
{ items: [{ type: 'image' }, { type: 'image' }] },
|
||||||
])
|
])
|
||||||
|
|
||||||
local = { attachments, limit: 4 }
|
local = { attachments, limit: 4 }
|
||||||
|
|
||||||
expect(Gallery.computed.rows.call(local)).to.eql([
|
expect(Gallery.computed.rows.call(local)).to.eql([
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
{ items: [{ mimetype: 'image/png' }, { mimetype: 'image/jpg' }] },
|
{ items: [{ type: 'image' }, { type: 'image' }] },
|
||||||
{ audio: true, items: [{ mimetype: 'audio/mpeg' }] },
|
{ audio: true, items: [{ type: 'audio' }] },
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,11 @@ describe('NotificationUtils', () => {
|
||||||
type: 'like',
|
type: 'like',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
expect(NotificationUtils.filteredNotificationsFromStore(store)).to.eql(
|
expect(NotificationUtils.filteredNotificationsFromStore(store, {
|
||||||
|
mentions: false,
|
||||||
|
likes: true,
|
||||||
|
repeats: true,
|
||||||
|
})).to.eql(
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
@ -77,16 +81,7 @@ describe('NotificationUtils', () => {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
getters: {
|
|
||||||
mergedConfig: {
|
|
||||||
notificationVisibility: {
|
|
||||||
likes: true,
|
|
||||||
repeats: true,
|
|
||||||
mentions: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
const expected = [
|
const expected = [
|
||||||
{
|
{
|
||||||
|
|
@ -95,7 +90,11 @@ describe('NotificationUtils', () => {
|
||||||
seen: false,
|
seen: false,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
expect(NotificationUtils.unseenNotificationsFromStore(store)).to.eql(
|
expect(NotificationUtils.unseenNotificationsFromStore(store, {
|
||||||
|
likes: true,
|
||||||
|
repeats: true,
|
||||||
|
mentions: false,
|
||||||
|
})).to.eql(
|
||||||
expected,
|
expected,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -493,11 +493,6 @@ describe('The SyncConfig store', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('_resetFlags', () => {
|
describe('_resetFlags', () => {
|
||||||
it('should reset all known flags to 0 when reset flag is set to > 0 and < 9000', () => {
|
|
||||||
const totalFlags = { a: 0, b: 3, reset: 1 }
|
|
||||||
|
|
||||||
expect(_resetFlags(totalFlags)).to.eql({ a: 0, b: 0, reset: 0 })
|
|
||||||
})
|
|
||||||
it('should trim all flags to known when reset is set to 1000', () => {
|
it('should trim all flags to known when reset is set to 1000', () => {
|
||||||
const totalFlags = { a: 0, b: 3, c: 33, reset: COMMAND_TRIM_FLAGS }
|
const totalFlags = { a: 0, b: 3, c: 33, reset: COMMAND_TRIM_FLAGS }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue