mirror of
https://github.com/ceph/ceph
synced 2025-02-19 17:08:05 +00:00
mgr/dashboard: fix linting in unittest
Signed-off-by: Laura Flores <lflores@redhat.com>
This commit is contained in:
parent
f7d6642f5e
commit
9158cbe9da
@ -171,16 +171,38 @@ describe('TelemetryComponent', () => {
|
||||
});
|
||||
|
||||
it('should only replace the ranges and values of a JSON object', () => {
|
||||
var report = component.replacerTest({'ranges': [[null, -1], [0, 511], [512, 1023]],
|
||||
'values': [[0,0,0], [0,0,0], [0,0,0]],
|
||||
'other': [[0,0,0], [0,0,0], [0,0,0]]});
|
||||
let report = component.replacerTest({
|
||||
ranges: [
|
||||
[null, -1],
|
||||
[0, 511],
|
||||
[512, 1023]
|
||||
],
|
||||
values: [
|
||||
[0, 0, 0],
|
||||
[0, 0, 0],
|
||||
[0, 0, 0]
|
||||
],
|
||||
other: [
|
||||
[0, 0, 0],
|
||||
[0, 0, 0],
|
||||
[0, 0, 0]
|
||||
]
|
||||
});
|
||||
report = JSON.parse(report);
|
||||
|
||||
// Ensure that the outer arrays have remained untouched by replacer
|
||||
expect(Array.isArray(report['ranges']) && Array.isArray(report['values']) && Array.isArray(report['other'])).toBeTruthy()
|
||||
expect(
|
||||
Array.isArray(report['ranges']) &&
|
||||
Array.isArray(report['values']) &&
|
||||
Array.isArray(report['other'])
|
||||
).toBeTruthy();
|
||||
|
||||
if (Array.isArray(report['ranges']) && Array.isArray(report['values']) && Array.isArray(report['other'])) {
|
||||
var idx;
|
||||
if (
|
||||
Array.isArray(report['ranges']) &&
|
||||
Array.isArray(report['values']) &&
|
||||
Array.isArray(report['other'])
|
||||
) {
|
||||
let idx;
|
||||
|
||||
// Check that each range in 'ranges' was replaced by a string
|
||||
for (idx = 0; idx < report['ranges'].length; idx++) {
|
||||
@ -196,7 +218,6 @@ describe('TelemetryComponent', () => {
|
||||
for (idx = 0; idx < report['other'].length; idx++) {
|
||||
expect(Array.isArray(report['other'][idx])).toBeTruthy();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user