From 38768a367bf41393128cc9476700b99022d7d92a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 12 Jan 2018 12:18:11 +0100 Subject: Fix lint --- server/initializers/migrations/0175-actor-follow-counts.ts | 1 - server/models/activitypub/actor-follow.ts | 7 +++---- server/tests/api/server/follows.ts | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'server') diff --git a/server/initializers/migrations/0175-actor-follow-counts.ts b/server/initializers/migrations/0175-actor-follow-counts.ts index 06ef77b49..4fb524181 100644 --- a/server/initializers/migrations/0175-actor-follow-counts.ts +++ b/server/initializers/migrations/0175-actor-follow-counts.ts @@ -1,5 +1,4 @@ import * as Sequelize from 'sequelize' -import { ACTOR_FOLLOW_SCORE } from '../index' async function up (utils: { transaction: Sequelize.Transaction, diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index 435d22db5..ced481547 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts @@ -2,9 +2,8 @@ import * as Bluebird from 'bluebird' import { values } from 'lodash' import * as Sequelize from 'sequelize' import { - AfterCreate, AfterDestroy, AfterUpdate, - AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, IsInt, Max, Model, Table, - UpdatedAt + AfterCreate, AfterDestroy, AfterUpdate, AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, IsInt, Max, Model, + Table, UpdatedAt } from 'sequelize-typescript' import { FollowState } from '../../../shared/models/actors' import { AccountFollow } from '../../../shared/models/actors/follow.model' @@ -83,7 +82,7 @@ export class ActorFollowModel extends Model { @AfterCreate @AfterUpdate static incrementFollowerAndFollowingCount (instance: ActorFollowModel) { - if (instance.state !== 'accepted') return + if (instance.state !== 'accepted') return undefined return Promise.all([ ActorModel.incrementFollows(instance.actorId, 'followingCount', 1), diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts index 27cf94985..d16e98bc1 100644 --- a/server/tests/api/server/follows.ts +++ b/server/tests/api/server/follows.ts @@ -117,7 +117,7 @@ describe('Test follows', function () { expect(follows.length).to.equal(0) }) - it('Should have the correct following counts', async function () { + it('Should have the correct follows counts', async function () { await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 2) await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0) await expectAccountFollows(servers[0].url, 'peertube@localhost:9003', 1, 0) @@ -158,7 +158,7 @@ describe('Test follows', function () { expect(follows.length).to.equal(0) }) - it('Should have the correct following counts 2', async function () { + it('Should have the correct follows counts 2', async function () { await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 1) await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0) @@ -248,7 +248,7 @@ describe('Test follows', function () { await wait(7000) }) - it('Should have the correct following counts 2', async function () { + it('Should have the correct follows counts 3', async function () { await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 2) await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0) await expectAccountFollows(servers[0].url, 'peertube@localhost:9003', 1, 0) -- cgit v1.2.3