Skip to content

Commit ff59a4a

Browse files
committed
Fix lint errors
1 parent 0e81338 commit ff59a4a

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

‎InfoLogger/test/public/live-mode-mocha.js‎

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
* In applying this license CERN does not waive the privileges and immunities
1111
* granted to it by virtue of its status as an Intergovernmental Organization
1212
* or submit itself to any jurisdiction.
13-
*/
14-
15-
/* eslint-disable max-len */
13+
*/
1614

1715
const assert = require('assert');
1816
const test = require('../mocha-index');
@@ -21,13 +19,11 @@ describe('Live Mode test-suite', async () => {
2119
let baseUrl;
2220
let page;
2321
before(async () => {
24-
baseUrl = test.helpers.baseUrl;
25-
page = test.page;
26-
22+
({ helpers: { baseUrl }, page } = test);
2723
});
2824

29-
it('should successfully go to homepage with predefined filters', async function() {
30-
await page.goto(baseUrl, {waitUntil: 'networkidle0'});
25+
it('should successfully go to homepage with predefined filters', async () => {
26+
await page.goto(baseUrl, { waitUntil: 'networkidle0' });
3127
const location = await page.evaluate(() => window.location);
3228
const search = decodeURIComponent(location.search);
3329

@@ -55,9 +51,9 @@ describe('Live Mode test-suite', async () => {
5551
assert.strictEqual(criterias.level.$max, 21);
5652

5753
// Wait for logs and count them (2-3 maybe, it's random)
58-
await page.waitForFunction(`window.model.log.list.length > 0`, {timeout: 5000});
54+
await page.waitForFunction('window.model.log.list.length > 0', { timeout: 5000 });
5955
const list = await page.evaluate(() => window.model.log.list);
60-
assert.ok(!!list.length);
56+
assert.ok(Boolean(list.length));
6157
});
6258

6359
it('should filter messages based on `hostname` matching `aldaqecs01-v1` from live -> paused -> live', async () => {
@@ -67,9 +63,11 @@ describe('Live Mode test-suite', async () => {
6763
window.model.log.filter.setCriteria('hostname', 'match', 'aldaqecs01-v1');
6864
});
6965
await page.evaluate(() => window.model.log.liveStart());
70-
await page.waitForFunction(`window.model.log.list.length > 5`, {timeout: 5000});
66+
await page.waitForFunction('window.model.log.list.length > 5', { timeout: 5000 });
7167
const list = await page.evaluate(() => window.model.log.list);
72-
const isHostNameMatching = list.map((element) => element.hostname).every((hostname) => hostname === 'aldaqecs01-v1');
68+
const isHostNameMatching = list
69+
.map((element) => element.hostname)
70+
.every((hostname) => hostname === 'aldaqecs01-v1');
7371
assert.ok(list.length > 0);
7472
assert.ok(isHostNameMatching);
7573
});
@@ -81,7 +79,7 @@ describe('Live Mode test-suite', async () => {
8179
window.model.log.filter.setCriteria('hostname', 'exclude', 'aldaqdip01');
8280
});
8381
await page.evaluate(() => window.model.log.liveStart());
84-
await page.waitForFunction(`window.model.log.list.length > 5`, {timeout: 5000});
82+
await page.waitForFunction('window.model.log.list.length > 5', { timeout: 5000 });
8583

8684
const list = await page.evaluate(() => window.model.log.list);
8785
const isHostNameMatching = list.map((element) => element.hostname).every((hostname) => hostname !== 'aldaqdip01');
@@ -90,18 +88,23 @@ describe('Live Mode test-suite', async () => {
9088
assert.ok(isHostNameMatching);
9189
});
9290

93-
it('should filter messages based on SQL Wildcards `hostname` excluding `%ldaqdip%` and username matching `a_iceda_` without changing state of live mode', async () => {
91+
it('should filter messages based on SQL Wildcards `hostname` excluding `%ldaqdip%` and username matching `a_iceda_`'
92+
+ ' without changing state of live mode', async () => {
9493
await page.evaluate(() => window.model.log.filter.resetCriteria());
9594
await page.evaluate(() => {
9695
window.model.log.setCriteria('hostname', 'exclude', '%ldaqdip%');
9796
window.model.log.setCriteria('username', 'match', 'a_iceda_');
9897
window.model.log.empty();
9998
});
100-
await page.waitForFunction(`window.model.log.list.length > 5`, {timeout: 5000});
99+
await page.waitForFunction('window.model.log.list.length > 5', { timeout: 5000 });
101100

102101
const list = await page.evaluate(() => window.model.log.list);
103-
const isHostNameMatching = list.map((element) => element.hostname).every((hostname) => !new RegExp('.*ldaqdip.*').test(hostname));
104-
const isUserNameMatching = list.map((element) => element.username).every((username) => new RegExp('a.iceda.').test(username));
102+
const isHostNameMatching = list
103+
.map((element) => element.hostname)
104+
.every((hostname) => !new RegExp('.*ldaqdip.*').test(hostname));
105+
const isUserNameMatching = list
106+
.map((element) => element.username)
107+
.every((username) => new RegExp('a.iceda.').test(username));
105108

106109
assert.ok(list.length > 0);
107110
assert.ok(isHostNameMatching);
@@ -155,8 +158,3 @@ describe('Live Mode test-suite', async () => {
155158
assert.deepStrictEqual(activeMode, 'Query');
156159
});
157160
});
158-
159-
160-
161-
162-

0 commit comments

Comments
 (0)