mirror of
https://github.com/wassname/talk.git
synced 2026-08-09 12:30:42 +08:00
Resolve linter issues
This commit is contained in:
@@ -57,7 +57,9 @@ module.exports = {
|
||||
},
|
||||
'User fills step 3': client => {
|
||||
const step3 = client.page.install().section.step3;
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
step3
|
||||
.setValue('@emailInput', admin.email)
|
||||
|
||||
@@ -22,7 +22,9 @@ module.exports = {
|
||||
|
||||
'Admin logs in': client => {
|
||||
const adminPage = client.page.admin();
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
|
||||
@@ -32,7 +32,9 @@ module.exports = {
|
||||
},
|
||||
|
||||
'creates an user and user logs in': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
// Go back to default asset.
|
||||
@@ -99,7 +101,9 @@ module.exports = {
|
||||
comments.logout();
|
||||
},
|
||||
'admin logs in': client => {
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
|
||||
@@ -20,7 +20,9 @@ module.exports = {
|
||||
|
||||
'Admin logs in': client => {
|
||||
const adminPage = client.page.admin();
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
@@ -84,7 +86,9 @@ module.exports = {
|
||||
client.page.admin().logout();
|
||||
},
|
||||
'user logs in': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
@@ -109,7 +113,9 @@ module.exports = {
|
||||
'user picks another username': client => {
|
||||
const embedStream = client.page.embedStream();
|
||||
const comments = embedStream.section.comments;
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
|
||||
comments
|
||||
.waitForElementVisible('@changeUsernameInput')
|
||||
@@ -134,7 +140,9 @@ module.exports = {
|
||||
},
|
||||
'Admin accepts the user flag': client => {
|
||||
const adminPage = client.page.admin();
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
|
||||
@@ -152,7 +160,9 @@ module.exports = {
|
||||
client.page.admin().logout();
|
||||
},
|
||||
'user logs in to check comment': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
|
||||
@@ -21,7 +21,9 @@ module.exports = {
|
||||
|
||||
'admin logs in': client => {
|
||||
const adminPage = client.page.admin();
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
@@ -53,7 +55,9 @@ module.exports = {
|
||||
comments.logout();
|
||||
},
|
||||
'user logs in': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
const comments = client.page.embedStream().section.comments;
|
||||
|
||||
comments.openLoginPopup(popup => popup.login(user));
|
||||
@@ -72,7 +76,9 @@ module.exports = {
|
||||
},
|
||||
'admin logs in (2)': client => {
|
||||
const adminPage = client.page.admin();
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
@@ -100,7 +106,9 @@ module.exports = {
|
||||
embedStream.navigate().ready();
|
||||
},
|
||||
'user logs in 2': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
const comments = client.page.embedStream().section.comments;
|
||||
|
||||
comments.openLoginPopup(popup => popup.login(user));
|
||||
@@ -134,7 +142,9 @@ module.exports = {
|
||||
},
|
||||
'admin logs in (3)': client => {
|
||||
const adminPage = client.page.admin();
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
|
||||
@@ -19,7 +19,9 @@ module.exports = {
|
||||
client.end();
|
||||
},
|
||||
'user logs in': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
const comments = client.page.embedStream().section.comments;
|
||||
|
||||
@@ -48,7 +50,9 @@ module.exports = {
|
||||
},
|
||||
'admin logs in': client => {
|
||||
const adminPage = client.page.admin();
|
||||
const { testData: { admin } } = client.globals;
|
||||
const {
|
||||
testData: { admin },
|
||||
} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
@@ -137,7 +141,9 @@ module.exports = {
|
||||
adminPage.logout();
|
||||
},
|
||||
'user logs in (2)': client => {
|
||||
const { testData: { user } } = client.globals;
|
||||
const {
|
||||
testData: { user },
|
||||
} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
const comments = client.page.embedStream().section.comments;
|
||||
|
||||
|
||||
@@ -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