1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-09 08:42:50 +03:00

Run eslint --fix

Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
This commit is contained in:
Luke Barnard
2017-10-11 17:56:17 +01:00
parent 8958be9321
commit d3f9a3aeb5
136 changed files with 2540 additions and 2657 deletions

View File

@@ -28,12 +28,12 @@ import MatrixClientPeg from '../../../../src/MatrixClientPeg';
import * as test_utils from '../../../test-utils';
const InteractiveAuthDialog = sdk.getComponent(
'views.dialogs.InteractiveAuthDialog'
'views.dialogs.InteractiveAuthDialog',
);
describe('InteractiveAuthDialog', function () {
var parentDiv;
var sandbox;
describe('InteractiveAuthDialog', function() {
let parentDiv;
let sandbox;
beforeEach(function() {
test_utils.beforeEach(this);
@@ -50,10 +50,10 @@ describe('InteractiveAuthDialog', function () {
it('Should successfully complete a password flow', function() {
const onFinished = sinon.spy();
const doRequest = sinon.stub().returns(Promise.resolve({a:1}));
const doRequest = sinon.stub().returns(Promise.resolve({a: 1}));
// tell the stub matrixclient to return a real userid
var client = MatrixClientPeg.get();
const client = MatrixClientPeg.get();
client.credentials = {userId: "@user:id"};
const dlg = ReactDOM.render(
@@ -62,8 +62,8 @@ describe('InteractiveAuthDialog', function () {
authData={{
session: "sess",
flows: [
{"stages":["m.login.password"]}
]
{"stages": ["m.login.password"]},
],
}}
makeRequest={doRequest}
onFinished={onFinished}
@@ -72,7 +72,7 @@ describe('InteractiveAuthDialog', function () {
// wait for a password box and a submit button
return MatrixReactTestUtils.waitForRenderedDOMComponentWithTag(dlg, "form", 2).then((formNode) => {
const inputNodes = ReactTestUtils.scryRenderedDOMComponentsWithTag(
dlg, "input"
dlg, "input",
);
let passwordNode;
let submitNode;
@@ -113,7 +113,7 @@ describe('InteractiveAuthDialog', function () {
return Promise.delay(1);
}).then(() => {
expect(onFinished.callCount).toEqual(1);
expect(onFinished.calledWithExactly(true, {a:1})).toBe(true);
expect(onFinished.calledWithExactly(true, {a: 1})).toBe(true);
});
});
});

View File

@@ -155,10 +155,10 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
@@ -191,10 +191,10 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
@@ -239,15 +239,15 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1 was unbanned, joined and left 7 times and was invited"
"user_1 was unbanned, joined and left 7 times and was invited",
);
});
@@ -292,16 +292,16 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1 was unbanned, joined and left 2 times, was banned, " +
"joined and left 3 times and was invited"
"joined and left 3 times and was invited",
);
});
@@ -351,15 +351,15 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1 and one other were unbanned, joined and left 2 times and were banned"
"user_1 and one other were unbanned, joined and left 2 times and were banned",
);
});
@@ -389,15 +389,15 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_0 and 19 others were unbanned, joined and left 2 times and were banned"
"user_0 and 19 others were unbanned, joined and left 2 times and were banned",
);
});
@@ -440,16 +440,16 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_2 was unbanned and joined and left 2 times, user_1 was unbanned, " +
"joined and left 2 times and was banned"
"joined and left 2 times and was banned",
);
});
@@ -507,16 +507,16 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1 was invited, was banned, joined, rejected their invitation, left, " +
"had their invitation withdrawn, was unbanned, was kicked and left"
"had their invitation withdrawn, was unbanned, was kicked and left",
);
});
@@ -554,16 +554,16 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1 and one other rejected their invitations and " +
"had their invitations withdrawn"
"had their invitations withdrawn",
);
});
@@ -590,15 +590,15 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1 rejected their invitation 2 times"
"user_1 rejected their invitation 2 times",
);
});
@@ -618,15 +618,15 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1 and user_2 joined 2 times"
"user_1 and user_2 joined 2 times",
);
});
@@ -645,15 +645,15 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_1, user_2 and one other joined"
"user_1, user_2 and one other joined",
);
});
@@ -670,15 +670,15 @@ describe('MemberEventListSummary', function() {
};
const instance = ReactTestUtils.renderIntoDocument(
<MemberEventListSummary {...props} />
<MemberEventListSummary {...props} />,
);
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
instance, "mx_MemberEventListSummary_summary"
instance, "mx_MemberEventListSummary_summary",
);
const summaryText = summary.innerText;
expect(summaryText).toBe(
"user_0, user_1 and 18 others joined"
"user_0, user_1 and 18 others joined",
);
});
});

View File

@@ -57,7 +57,7 @@ describe('MessageComposerInput', () => {
}
sandbox.restore();
done();
})
});
});
// XXX this fails