diff options
Diffstat (limited to 'server/tests/plugins/plugin-storage.ts')
-rw-r--r-- | server/tests/plugins/plugin-storage.ts | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/server/tests/plugins/plugin-storage.ts b/server/tests/plugins/plugin-storage.ts index 3c46b2585..4c65463f2 100644 --- a/server/tests/plugins/plugin-storage.ts +++ b/server/tests/plugins/plugin-storage.ts | |||
@@ -7,13 +7,14 @@ import { join } from 'path' | |||
7 | import { HttpStatusCode } from '@shared/core-utils' | 7 | import { HttpStatusCode } from '@shared/core-utils' |
8 | import { | 8 | import { |
9 | buildServerDirectory, | 9 | buildServerDirectory, |
10 | getPluginTestPath, | 10 | cleanupTests, |
11 | installPlugin, | 11 | flushAndRunServer, |
12 | makeGetRequest, | 12 | makeGetRequest, |
13 | PluginsCommand, | ||
14 | ServerInfo, | ||
13 | setAccessTokensToServers, | 15 | setAccessTokensToServers, |
14 | uninstallPlugin | 16 | waitUntilLog |
15 | } from '../../../shared/extra-utils' | 17 | } from '@shared/extra-utils' |
16 | import { cleanupTests, flushAndRunServer, ServerInfo, waitUntilLog } from '../../../shared/extra-utils/server/servers' | ||
17 | 18 | ||
18 | describe('Test plugin storage', function () { | 19 | describe('Test plugin storage', function () { |
19 | let server: ServerInfo | 20 | let server: ServerInfo |
@@ -24,11 +25,7 @@ describe('Test plugin storage', function () { | |||
24 | server = await flushAndRunServer(1) | 25 | server = await flushAndRunServer(1) |
25 | await setAccessTokensToServers([ server ]) | 26 | await setAccessTokensToServers([ server ]) |
26 | 27 | ||
27 | await installPlugin({ | 28 | await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-six') }) |
28 | url: server.url, | ||
29 | accessToken: server.accessToken, | ||
30 | path: getPluginTestPath('-six') | ||
31 | }) | ||
32 | }) | 29 | }) |
33 | 30 | ||
34 | describe('DB storage', function () { | 31 | describe('DB storage', function () { |
@@ -76,22 +73,14 @@ describe('Test plugin storage', function () { | |||
76 | }) | 73 | }) |
77 | 74 | ||
78 | it('Should still have the file after an uninstallation', async function () { | 75 | it('Should still have the file after an uninstallation', async function () { |
79 | await uninstallPlugin({ | 76 | await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-six' }) |
80 | url: server.url, | ||
81 | accessToken: server.accessToken, | ||
82 | npmName: 'peertube-plugin-test-six' | ||
83 | }) | ||
84 | 77 | ||
85 | const content = await getFileContent() | 78 | const content = await getFileContent() |
86 | expect(content).to.equal('Prince Ali') | 79 | expect(content).to.equal('Prince Ali') |
87 | }) | 80 | }) |
88 | 81 | ||
89 | it('Should still have the file after the reinstallation', async function () { | 82 | it('Should still have the file after the reinstallation', async function () { |
90 | await installPlugin({ | 83 | await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-six') }) |
91 | url: server.url, | ||
92 | accessToken: server.accessToken, | ||
93 | path: getPluginTestPath('-six') | ||
94 | }) | ||
95 | 84 | ||
96 | const content = await getFileContent() | 85 | const content = await getFileContent() |
97 | expect(content).to.equal('Prince Ali') | 86 | expect(content).to.equal('Prince Ali') |