PeerTubeServer,
prepareNotificationsTest,
wait
-} from '@shared/extra-utils'
+} from '@shared/server-commands'
import { PluginType, UserNotification, UserNotificationType } from '@shared/models'
describe('Test admin notifications', function () {
joinPeerTubeServer.setLatestVersion('1.4.2')
await wait(3000)
- await checkNewPeerTubeVersion(baseParams, '1.4.2', 'absence')
+ await checkNewPeerTubeVersion({ ...baseParams, latestVersion: '1.4.2', checkType: 'absence' })
})
it('Should send a notification to admins on new plugin version', async function () {
joinPeerTubeServer.setLatestVersion('15.4.2')
await wait(3000)
- await checkNewPeerTubeVersion(baseParams, '15.4.2', 'presence')
+ await checkNewPeerTubeVersion({ ...baseParams, latestVersion: '15.4.2', checkType: 'presence' })
})
it('Should not send the same notification to admins', async function () {
joinPeerTubeServer.setLatestVersion('15.4.3')
await wait(3000)
- await checkNewPeerTubeVersion(baseParams, '15.4.3', 'presence')
+ await checkNewPeerTubeVersion({ ...baseParams, latestVersion: '15.4.3', checkType: 'presence' })
expect(adminNotifications.filter(n => n.type === UserNotificationType.NEW_PEERTUBE_VERSION)).to.have.lengthOf(2)
})
})
this.timeout(30000)
await wait(6000)
- await checkNewPluginVersion(baseParams, PluginType.PLUGIN, 'hello-world', 'absence')
+ await checkNewPluginVersion({ ...baseParams, pluginType: PluginType.PLUGIN, pluginName: 'hello-world', checkType: 'absence' })
})
it('Should send a notification to admins on new plugin version', async function () {
await server.sql.setPluginLatestVersion('hello-world', '0.0.1')
await wait(6000)
- await checkNewPluginVersion(baseParams, PluginType.PLUGIN, 'hello-world', 'presence')
+ await checkNewPluginVersion({ ...baseParams, pluginType: PluginType.PLUGIN, pluginName: 'hello-world', checkType: 'presence' })
})
it('Should not send the same notification to admins', async function () {