diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-15 13:52:27 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-15 13:52:27 +0200 |
commit | f6500729850549e632399155d0f3b69822e28b16 (patch) | |
tree | 7ca40188e38b0281f538c4cddf79ea633745cc4a /server/tests/api/notifications/admin-notifications.ts | |
parent | f1ac63488c0050fec1c4d713d74db4f4ea944395 (diff) | |
download | PeerTube-f6500729850549e632399155d0f3b69822e28b16.tar.gz PeerTube-f6500729850549e632399155d0f3b69822e28b16.tar.zst PeerTube-f6500729850549e632399155d0f3b69822e28b16.zip |
More robust tests
Diffstat (limited to 'server/tests/api/notifications/admin-notifications.ts')
-rw-r--r-- | server/tests/api/notifications/admin-notifications.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts index e07327d74..cfe0bd2bb 100644 --- a/server/tests/api/notifications/admin-notifications.ts +++ b/server/tests/api/notifications/admin-notifications.ts | |||
@@ -3,6 +3,7 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { MockJoinPeerTubeVersions } from '@shared/extra-utils/mock-servers/joinpeertube-versions' | 5 | import { MockJoinPeerTubeVersions } from '@shared/extra-utils/mock-servers/joinpeertube-versions' |
6 | import { PluginType } from '@shared/models' | ||
6 | import { cleanupTests, installPlugin, setPluginLatestVersion, setPluginVersion, wait } from '../../../../shared/extra-utils' | 7 | import { cleanupTests, installPlugin, setPluginLatestVersion, setPluginVersion, wait } from '../../../../shared/extra-utils' |
7 | import { ServerInfo } from '../../../../shared/extra-utils/index' | 8 | import { ServerInfo } from '../../../../shared/extra-utils/index' |
8 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 9 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' |
@@ -13,7 +14,6 @@ import { | |||
13 | prepareNotificationsTest | 14 | prepareNotificationsTest |
14 | } from '../../../../shared/extra-utils/users/user-notifications' | 15 | } from '../../../../shared/extra-utils/users/user-notifications' |
15 | import { UserNotification, UserNotificationType } from '../../../../shared/models/users' | 16 | import { UserNotification, UserNotificationType } from '../../../../shared/models/users' |
16 | import { PluginType } from '@shared/models' | ||
17 | 17 | ||
18 | describe('Test admin notifications', function () { | 18 | describe('Test admin notifications', function () { |
19 | let server: ServerInfo | 19 | let server: ServerInfo |
@@ -26,11 +26,14 @@ describe('Test admin notifications', function () { | |||
26 | before(async function () { | 26 | before(async function () { |
27 | this.timeout(120000) | 27 | this.timeout(120000) |
28 | 28 | ||
29 | joinPeerTubeServer = new MockJoinPeerTubeVersions() | ||
30 | const port = await joinPeerTubeServer.initialize() | ||
31 | |||
29 | const config = { | 32 | const config = { |
30 | peertube: { | 33 | peertube: { |
31 | check_latest_version: { | 34 | check_latest_version: { |
32 | enabled: true, | 35 | enabled: true, |
33 | url: 'http://localhost:42102/versions.json' | 36 | url: `http://localhost:${port}/versions.json` |
34 | } | 37 | } |
35 | }, | 38 | }, |
36 | plugins: { | 39 | plugins: { |
@@ -66,9 +69,6 @@ describe('Test admin notifications', function () { | |||
66 | accessToken: server.accessToken, | 69 | accessToken: server.accessToken, |
67 | npmName: 'peertube-theme-background-red' | 70 | npmName: 'peertube-theme-background-red' |
68 | }) | 71 | }) |
69 | |||
70 | joinPeerTubeServer = new MockJoinPeerTubeVersions() | ||
71 | await joinPeerTubeServer.initialize() | ||
72 | }) | 72 | }) |
73 | 73 | ||
74 | describe('Latest PeerTube version notification', function () { | 74 | describe('Latest PeerTube version notification', function () { |