Resolve linter issues

This commit is contained in:
Chi Vinh Le
2018-06-05 04:28:54 +02:00
parent d9a1d739dc
commit ccff6ed63b
148 changed files with 1171 additions and 265 deletions
+9 -3
View File
@@ -12,7 +12,9 @@ describe('graph.loaders.Actions', () => {
{ item_id: 'comment_1' },
{ item_id: 'comment_2' },
]);
const { Actions: { getAuthoredByID } } = loaders({
const {
Actions: { getAuthoredByID },
} = loaders({
user: { id: 'user_1' },
connectors: { services: { Actions: { getUserActions: spy } } },
});
@@ -34,7 +36,9 @@ describe('graph.loaders.Actions', () => {
describe('#getSummariesByItem', () => {
describe('logged out user', () => {
it('does not include any user data', async () => {
const { Actions: { getSummariesByItem } } = loaders({
const {
Actions: { getSummariesByItem },
} = loaders({
loaders: {
Actions: {
getAuthoredByID: {
@@ -72,7 +76,9 @@ describe('graph.loaders.Actions', () => {
describe('logged in user', () => {
it('does include user', async () => {
const { Actions: { getSummariesByItem } } = loaders({
const {
Actions: { getSummariesByItem },
} = loaders({
loaders: {
Actions: {
getAuthoredByID: {
+3 -6
View File
@@ -195,8 +195,7 @@ describe('graph.mutations.createComment', () => {
AssetModel.create({
id: '123',
settings: { disableCommenting: disabled },
})
);
}));
it(
error ? 'does not create the comment' : 'creates the comment',
@@ -234,8 +233,7 @@ describe('graph.mutations.createComment', () => {
].forEach(({ moderation, status }) => {
describe(`moderation=${moderation}`, () => {
beforeEach(() =>
AssetModel.create({ id: '123', settings: { moderation } })
);
AssetModel.create({ id: '123', settings: { moderation } }));
it(`creates comment with status=${status}`, () => {
const context = new Context({ user: new UserModel() });
@@ -263,8 +261,7 @@ describe('graph.mutations.createComment', () => {
SettingsService.update({
wordlist: { banned: ['WORST'], suspect: ['EH'] },
}),
])
);
]));
[
{
+1 -2
View File
@@ -75,8 +75,7 @@ describe('/api/v1/auth/local', () => {
describe('email confirmation enabled', () => {
beforeEach(() =>
SettingsService.update({ requireEmailConfirmation: true })
);
SettingsService.update({ requireEmailConfirmation: true }));
describe('#post', () => {
it('should not allow a login from a user that is not confirmed', () => {
+1 -2
View File
@@ -7,8 +7,7 @@ describe('services.Settings', () => {
Settings.init({
moderation: 'PRE',
wordlist: { banned: ['bannedWord'], suspect: [] },
})
);
}));
describe('#retrieve()', () => {
it('should have a moderation field defined', () => {
+12 -4
View File
@@ -38,7 +38,9 @@ describe('services.TokensService', () => {
describe('#revoke', () => {
it('can revoke a token', async () => {
let { pat: { id } } = await TokensService.create(user.id, 'GitHub Token');
let {
pat: { id },
} = await TokensService.create(user.id, 'GitHub Token');
let tokens = await TokensService.list(user.id);
expect(tokens).to.have.length(1);
@@ -57,7 +59,9 @@ describe('services.TokensService', () => {
describe('#validate', () => {
it('will allow a valid token', async () => {
// Create a token.
let { pat: { id } } = await TokensService.create(user.id, 'GitHub Token');
let {
pat: { id },
} = await TokensService.create(user.id, 'GitHub Token');
// Validate it.
await TokensService.validate(user.id, id);
@@ -65,7 +69,9 @@ describe('services.TokensService', () => {
it('will not allow an invalid token', async () => {
// Create a token.
let { pat: { id } } = await TokensService.create(user.id, 'GitHub Token');
let {
pat: { id },
} = await TokensService.create(user.id, 'GitHub Token');
// Revoke it.
await TokensService.revoke(user.id, id);
@@ -81,7 +87,9 @@ describe('services.TokensService', () => {
expect(tokens).to.have.length(0);
// Create a token.
let { pat: { id } } = await TokensService.create(user.id, 'GitHub Token');
let {
pat: { id },
} = await TokensService.create(user.id, 'GitHub Token');
tokens = await TokensService.list(user.id);
expect(tokens).to.have.length(1);