mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Merge branch 'master' into 142993479-tags
This commit is contained in:
@@ -204,7 +204,7 @@ describe('services.CommentsService', () => {
|
||||
it('should return all comments if admin', () => {
|
||||
return CommentsService
|
||||
.findByUserId('456', true)
|
||||
.then(comments => {
|
||||
.then((comments) => {
|
||||
expect(comments).to.have.length(4);
|
||||
});
|
||||
});
|
||||
@@ -212,7 +212,7 @@ describe('services.CommentsService', () => {
|
||||
it('should not return premod and rejected comments if not admin', () => {
|
||||
return CommentsService
|
||||
.findByUserId('456')
|
||||
.then(comments => {
|
||||
.then((comments) => {
|
||||
expect(comments).to.have.length(1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,13 +7,13 @@ describe('services.SettingsService', () => {
|
||||
|
||||
describe('#retrieve()', () => {
|
||||
it('should have a moderation field defined', () => {
|
||||
return SettingsService.retrieve().then(settings => {
|
||||
return SettingsService.retrieve().then((settings) => {
|
||||
expect(settings).to.have.property('moderation').and.to.equal('PRE');
|
||||
});
|
||||
});
|
||||
|
||||
it('should have two infoBox fields defined', () => {
|
||||
return SettingsService.retrieve().then(settings => {
|
||||
return SettingsService.retrieve().then((settings) => {
|
||||
expect(settings).to.have.property('infoBoxEnable').and.to.equal(false);
|
||||
expect(settings).to.have.property('infoBoxContent').and.to.equal('');
|
||||
});
|
||||
@@ -23,7 +23,7 @@ describe('services.SettingsService', () => {
|
||||
describe('#update()', () => {
|
||||
it('should update the settings with a passed object', () => {
|
||||
const mockSettings = {moderation: 'POST', infoBoxEnable: true, infoBoxContent: 'yeah'};
|
||||
return SettingsService.update(mockSettings).then(updatedSettings => {
|
||||
return SettingsService.update(mockSettings).then((updatedSettings) => {
|
||||
expect(updatedSettings).to.be.an('object');
|
||||
expect(updatedSettings).to.have.property('moderation').and.to.equal('POST');
|
||||
expect(updatedSettings).to.have.property('infoBoxEnable', true);
|
||||
|
||||
@@ -173,12 +173,12 @@ describe('services.UsersService', () => {
|
||||
it('should add user id to ignoredUsers set', async () => {
|
||||
const user = mockUsers[0];
|
||||
const usersToIgnore = [mockUsers[1], mockUsers[2]];
|
||||
await UsersService.ignoreUsers(user.id, usersToIgnore.map(u => u.id));
|
||||
await UsersService.ignoreUsers(user.id, usersToIgnore.map((u) => u.id));
|
||||
const userAfterIgnoring = await UsersService.findById(user.id);
|
||||
expect(userAfterIgnoring.ignoresUsers.length).to.equal(2);
|
||||
|
||||
// ignore same user another time, make sure it's not added to the list.
|
||||
await UsersService.ignoreUsers(user.id, usersToIgnore.slice(0, 1).map(u => u.id));
|
||||
await UsersService.ignoreUsers(user.id, usersToIgnore.slice(0, 1).map((u) => u.id));
|
||||
const userAfterIgnoring2 = await UsersService.findById(user.id);
|
||||
expect(userAfterIgnoring2.ignoresUsers.length).to.equal(2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user