mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 17:25:50 +03:00
Remove a couple more files from eslintignore
Just var/const & spaces
This commit is contained in:
parent
7ec1d5a881
commit
db0d74d0d4
3 changed files with 24 additions and 32 deletions
|
@ -12,8 +12,6 @@ src/utils/MultiInviter.js
|
||||||
test/components/structures/MessagePanel-test.js
|
test/components/structures/MessagePanel-test.js
|
||||||
test/components/views/dialogs/InteractiveAuthDialog-test.js
|
test/components/views/dialogs/InteractiveAuthDialog-test.js
|
||||||
test/mock-clock.js
|
test/mock-clock.js
|
||||||
test/notifications/ContentRules-test.js
|
|
||||||
test/notifications/PushRuleVectorState-test.js
|
|
||||||
src/component-index.js
|
src/component-index.js
|
||||||
test/end-to-end-tests/node_modules/
|
test/end-to-end-tests/node_modules/
|
||||||
test/end-to-end-tests/riot/
|
test/end-to-end-tests/riot/
|
||||||
|
|
|
@ -14,15 +14,12 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var notifications = require('../../src/notifications');
|
const notifications = require('../../src/notifications');
|
||||||
|
|
||||||
var ContentRules = notifications.ContentRules;
|
const ContentRules = notifications.ContentRules;
|
||||||
var PushRuleVectorState = notifications.PushRuleVectorState;
|
const PushRuleVectorState = notifications.PushRuleVectorState;
|
||||||
|
|
||||||
var expect = require('expect');
|
const NORMAL_RULE = {
|
||||||
var test_utils = require('../test-utils');
|
|
||||||
|
|
||||||
var NORMAL_RULE = {
|
|
||||||
actions: [
|
actions: [
|
||||||
"notify",
|
"notify",
|
||||||
{ set_tweak: "highlight", value: false },
|
{ set_tweak: "highlight", value: false },
|
||||||
|
@ -32,7 +29,7 @@ var NORMAL_RULE = {
|
||||||
rule_id: "vdh2",
|
rule_id: "vdh2",
|
||||||
};
|
};
|
||||||
|
|
||||||
var LOUD_RULE = {
|
const LOUD_RULE = {
|
||||||
actions: [
|
actions: [
|
||||||
"notify",
|
"notify",
|
||||||
{ set_tweak: "highlight" },
|
{ set_tweak: "highlight" },
|
||||||
|
@ -43,7 +40,7 @@ var LOUD_RULE = {
|
||||||
rule_id: "vdh2",
|
rule_id: "vdh2",
|
||||||
};
|
};
|
||||||
|
|
||||||
var USERNAME_RULE = {
|
const USERNAME_RULE = {
|
||||||
actions: [
|
actions: [
|
||||||
"notify",
|
"notify",
|
||||||
{ set_tweak: "sound", value: "default" },
|
{ set_tweak: "sound", value: "default" },
|
||||||
|
@ -56,26 +53,25 @@ var USERNAME_RULE = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
describe("ContentRules", function() {
|
describe("ContentRules", function() {
|
||||||
describe("parseContentRules", function() {
|
describe("parseContentRules", function() {
|
||||||
it("should handle there being no keyword rules", function() {
|
it("should handle there being no keyword rules", function() {
|
||||||
var rules = { 'global': { 'content': [
|
const rules = { 'global': { 'content': [
|
||||||
USERNAME_RULE,
|
USERNAME_RULE,
|
||||||
]}};
|
]}};
|
||||||
var parsed = ContentRules.parseContentRules(rules);
|
const parsed = ContentRules.parseContentRules(rules);
|
||||||
expect(parsed.rules).toEqual([]);
|
expect(parsed.rules).toEqual([]);
|
||||||
expect(parsed.vectorState).toEqual(PushRuleVectorState.ON);
|
expect(parsed.vectorState).toEqual(PushRuleVectorState.ON);
|
||||||
expect(parsed.externalRules).toEqual([]);
|
expect(parsed.externalRules).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should parse regular keyword notifications", function() {
|
it("should parse regular keyword notifications", function() {
|
||||||
var rules = { 'global': { 'content': [
|
const rules = { 'global': { 'content': [
|
||||||
NORMAL_RULE,
|
NORMAL_RULE,
|
||||||
USERNAME_RULE,
|
USERNAME_RULE,
|
||||||
]}};
|
]}};
|
||||||
|
|
||||||
var parsed = ContentRules.parseContentRules(rules);
|
const parsed = ContentRules.parseContentRules(rules);
|
||||||
expect(parsed.rules.length).toEqual(1);
|
expect(parsed.rules.length).toEqual(1);
|
||||||
expect(parsed.rules[0]).toEqual(NORMAL_RULE);
|
expect(parsed.rules[0]).toEqual(NORMAL_RULE);
|
||||||
expect(parsed.vectorState).toEqual(PushRuleVectorState.ON);
|
expect(parsed.vectorState).toEqual(PushRuleVectorState.ON);
|
||||||
|
@ -83,12 +79,12 @@ describe("ContentRules", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should parse loud keyword notifications", function() {
|
it("should parse loud keyword notifications", function() {
|
||||||
var rules = { 'global': { 'content': [
|
const rules = { 'global': { 'content': [
|
||||||
LOUD_RULE,
|
LOUD_RULE,
|
||||||
USERNAME_RULE,
|
USERNAME_RULE,
|
||||||
]}};
|
]}};
|
||||||
|
|
||||||
var parsed = ContentRules.parseContentRules(rules);
|
const parsed = ContentRules.parseContentRules(rules);
|
||||||
expect(parsed.rules.length).toEqual(1);
|
expect(parsed.rules.length).toEqual(1);
|
||||||
expect(parsed.rules[0]).toEqual(LOUD_RULE);
|
expect(parsed.rules[0]).toEqual(LOUD_RULE);
|
||||||
expect(parsed.vectorState).toEqual(PushRuleVectorState.LOUD);
|
expect(parsed.vectorState).toEqual(PushRuleVectorState.LOUD);
|
||||||
|
@ -96,13 +92,13 @@ describe("ContentRules", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should parse mixed keyword notifications", function() {
|
it("should parse mixed keyword notifications", function() {
|
||||||
var rules = { 'global': { 'content': [
|
const rules = { 'global': { 'content': [
|
||||||
LOUD_RULE,
|
LOUD_RULE,
|
||||||
NORMAL_RULE,
|
NORMAL_RULE,
|
||||||
USERNAME_RULE,
|
USERNAME_RULE,
|
||||||
]}};
|
]}};
|
||||||
|
|
||||||
var parsed = ContentRules.parseContentRules(rules);
|
const parsed = ContentRules.parseContentRules(rules);
|
||||||
expect(parsed.rules.length).toEqual(1);
|
expect(parsed.rules.length).toEqual(1);
|
||||||
expect(parsed.rules[0]).toEqual(LOUD_RULE);
|
expect(parsed.rules[0]).toEqual(LOUD_RULE);
|
||||||
expect(parsed.vectorState).toEqual(PushRuleVectorState.LOUD);
|
expect(parsed.vectorState).toEqual(PushRuleVectorState.LOUD);
|
||||||
|
|
|
@ -14,16 +14,14 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var notifications = require('../../src/notifications');
|
const notifications = require('../../src/notifications');
|
||||||
|
|
||||||
var prvs = notifications.PushRuleVectorState;
|
const prvs = notifications.PushRuleVectorState;
|
||||||
|
|
||||||
var expect = require('expect');
|
|
||||||
|
|
||||||
describe("PushRuleVectorState", function() {
|
describe("PushRuleVectorState", function() {
|
||||||
describe("contentRuleVectorStateKind", function() {
|
describe("contentRuleVectorStateKind", function() {
|
||||||
it("should understand normal notifications", function() {
|
it("should understand normal notifications", function() {
|
||||||
var rule = {
|
const rule = {
|
||||||
actions: [
|
actions: [
|
||||||
"notify",
|
"notify",
|
||||||
],
|
],
|
||||||
|
@ -34,12 +32,12 @@ describe("PushRuleVectorState", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle loud notifications", function() {
|
it("should handle loud notifications", function() {
|
||||||
var rule = {
|
const rule = {
|
||||||
actions: [
|
actions: [
|
||||||
"notify",
|
"notify",
|
||||||
{ set_tweak: "highlight", value: true },
|
{ set_tweak: "highlight", value: true },
|
||||||
{ set_tweak: "sound", value: "default" },
|
{ set_tweak: "sound", value: "default" },
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(prvs.contentRuleVectorStateKind(rule)).
|
expect(prvs.contentRuleVectorStateKind(rule)).
|
||||||
|
@ -47,12 +45,12 @@ describe("PushRuleVectorState", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should understand missing highlight.value", function() {
|
it("should understand missing highlight.value", function() {
|
||||||
var rule = {
|
const rule = {
|
||||||
actions: [
|
actions: [
|
||||||
"notify",
|
"notify",
|
||||||
{ set_tweak: "highlight" },
|
{ set_tweak: "highlight" },
|
||||||
{ set_tweak: "sound", value: "default" },
|
{ set_tweak: "sound", value: "default" },
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(prvs.contentRuleVectorStateKind(rule)).
|
expect(prvs.contentRuleVectorStateKind(rule)).
|
||||||
|
|
Loading…
Reference in a new issue