fix(web): [OCISDEV-1540] mark all notifications as read in the notifications menu (#13157)
This commit is contained in:
1 parent
63fced12a6
commit
c9856ef000
3 files changed
+19
-2
No files matched your search
@@ -0,0 +1,10 @@
|
||||
Bugfix: Mark all notifications as read
|
||||
|
||||
Clicking "Mark all read" in the notifications menu only cleared the list
|
||||
visually. The request sent to the server was malformed, so the notifications
|
||||
were not deleted and reappeared after a page reload. This affected the regular
|
||||
view as well as the Safe.
|
||||
|
||||
The request is now sent correctly and the notifications are removed for good.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13157
|
||||
@@ -222,7 +222,7 @@ export default {
|
||||
try {
|
||||
yield clientService.httpAuthenticated.delete(
|
||||
'ocs/v2.php/apps/notifications/api/v1/notifications',
|
||||
{ data: { ids } },
|
||||
{ ids },
|
||||
{ signal }
|
||||
)
|
||||
} catch (e) {
|
||||
|
||||
@@ -61,13 +61,20 @@ describe('Notification component', () => {
|
||||
expect(wrapper.find(selectors.notificationsLoading).exists()).toBeTruthy()
|
||||
})
|
||||
it('marks all notifications as read', async () => {
|
||||
const notifications = [mock<Notification>({ messageRich: undefined, object_id })]
|
||||
const notifications = [
|
||||
mock<Notification>({ messageRich: undefined, object_id, notification_id: 'n1' })
|
||||
]
|
||||
const { wrapper, mocks } = getWrapper({ notifications })
|
||||
await wrapper.vm.fetchNotificationsTask.last
|
||||
await wrapper.find(selectors.markAll).trigger('click')
|
||||
await wrapper.vm.$nextTick()
|
||||
expect(wrapper.find(selectors.notificationItem).exists()).toBeFalsy()
|
||||
expect(mocks.$clientService.httpAuthenticated.delete).toHaveBeenCalledTimes(1)
|
||||
expect(mocks.$clientService.httpAuthenticated.delete).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
{ ids: ['n1'] },
|
||||
expect.anything()
|
||||
)
|
||||
})
|
||||
describe('avatar', () => {
|
||||
it('loads based on the username', async () => {
|
||||
|
||||
Reference in new issue
Block a user