mirror of
https://github.com/wassname/talk.git
synced 2026-08-03 13:20:59 +08:00
Resolve linter issues
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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'] },
|
||||
}),
|
||||
])
|
||||
);
|
||||
]));
|
||||
|
||||
[
|
||||
{
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -7,8 +7,7 @@ describe('services.Settings', () => {
|
||||
Settings.init({
|
||||
moderation: 'PRE',
|
||||
wordlist: { banned: ['bannedWord'], suspect: [] },
|
||||
})
|
||||
);
|
||||
}));
|
||||
|
||||
describe('#retrieve()', () => {
|
||||
it('should have a moderation field defined', () => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user