From a9bfa85d2cdf13670aaced740da5b493fbeddfce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Dec 2021 15:58:10 +0100 Subject: Add ability for admins to set default p2p policy --- server/tests/api/users/users.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'server/tests/api/users') diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 6c41e7d56..f00cbab5a 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -559,6 +559,28 @@ describe('Test users', function () { expect(user.autoPlayNextVideo).to.be.true }) + it('Should be able to change the p2p attribute', async function () { + { + await server.users.updateMe({ + token: userToken, + webTorrentEnabled: false + }) + + const user = await server.users.getMyInfo({ token: userToken }) + expect(user.p2pEnabled).to.be.false + } + + { + await server.users.updateMe({ + token: userToken, + p2pEnabled: true + }) + + const user = await server.users.getMyInfo({ token: userToken }) + expect(user.p2pEnabled).to.be.true + } + }) + it('Should be able to change the email attribute', async function () { await server.users.updateMe({ token: userToken, -- cgit v1.2.3