+
+ it('Should search through account videos', async function () {
+ const created = await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'Kami no chikara' } })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const { total, data } = await server.videos.listByAccount({ handle: 'user1@' + servers[0].host, search: 'Kami' })
+
+ expect(total).to.equal(1)
+ expect(data).to.be.an('array')
+ expect(data).to.have.lengthOf(1)
+ expect(data[0].uuid).to.equal(created.uuid)
+ }
+ })
+
+ it('Should remove the user', async function () {
+ this.timeout(10_000)
+
+ for (const server of servers) {
+ const body = await server.accounts.list({ sort: '-createdAt' })
+
+ const accountDeleted = body.data.find(a => a.name === 'user1' && a.host === servers[0].host)
+ expect(accountDeleted).not.to.be.undefined
+
+ const { data } = await server.channels.list()
+ const videoChannelDeleted = data.find(a => a.displayName === 'Main user1 channel' && a.host === servers[0].host)
+ expect(videoChannelDeleted).not.to.be.undefined
+ }
+
+ await servers[0].users.remove({ userId })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const body = await server.accounts.list({ sort: '-createdAt' })
+
+ const accountDeleted = body.data.find(a => a.name === 'user1' && a.host === servers[0].host)
+ expect(accountDeleted).to.be.undefined
+
+ const { data } = await server.channels.list()
+ const videoChannelDeleted = data.find(a => a.name === 'Main user1 channel' && a.host === servers[0].host)
+ expect(videoChannelDeleted).to.be.undefined
+ }
+ })
+
+ it('Should not have actor files', async () => {
+ for (const server of servers) {
+ for (const userAvatarFilename of userAvatarFilenames) {
+ await checkActorFilesWereRemoved(userAvatarFilename, server)
+ }
+ }
+ })
+
+ it('Should not have video files', async () => {
+ for (const server of servers) {
+ await checkVideoFilesWereRemoved({ server, video: server.store.videoDetails })
+ }
+ })
+
+ it('Should have an empty tmp directory', async function () {
+ for (const server of servers) {
+ await checkTmpIsEmpty(server)
+ }
+ })
+
+ after(async function () {
+ await cleanupTests(servers)
+ })