/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
import {
CheckerBaseParams,
checkNewVideoFromSubscription,
import { UserNotification, UserNotificationSettingValue } from '@shared/models'
import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
-const expect = chai.expect
-
describe('Test notifications API', function () {
let server: PeerTubeServer
let userNotifications: UserNotification[] = []
await waitJobs([ server ])
})
+ describe('Notification list & count', function () {
+
+ it('Should correctly list notifications', async function () {
+ const { data, total } = await server.notifications.list({ token: userToken, start: 0, count: 2 })
+
+ expect(data).to.have.lengthOf(2)
+ expect(total).to.equal(10)
+ })
+ })
+
describe('Mark as read', function () {
it('Should mark as read some notifications', async function () {
before(() => {
baseParams = {
- server: server,
+ server,
emails,
socketNotifications: userNotifications,
token: userToken