import 'mocha'
import * as chai from 'chai'
+import { testImage } from '@server/tests/shared'
+import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models'
import {
cleanupTests,
createSingleServer,
makePutBodyRequest,
PeerTubeServer,
setAccessTokensToServers,
- testImage,
waitJobs
-} from '@shared/extra-utils'
-import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models'
+} from '@shared/server-commands'
const expect = chai.expect
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,