Commit fdc13baf authored by Jose Vargas's avatar Jose Vargas

Add nullish coalesce checks, touch up specs

parent 1f829bfb
......@@ -132,13 +132,11 @@ export const logLinesParserLegacy = (lines = [], accumulator = []) =>
);
export const logLinesParser = (lines = [], previousTraceState = {}, prevParsedLines = []) => {
let currentLine = previousTraceState?.prevLineCount ? previousTraceState.prevLineCount : 0;
let currentHeader = previousTraceState?.currentHeader ? previousTraceState.currentHeader : null;
let isPreviousLineHeader = previousTraceState?.isPreviousLineHeader
? previousTraceState.isPreviousLineHeader
: false;
let currentLine = previousTraceState?.prevLineCount ?? 0;
let currentHeader = previousTraceState?.currentHeader;
let isPreviousLineHeader = previousTraceState?.isPreviousLineHeader ?? false;
const parsedLines = prevParsedLines.length > 0 ? prevParsedLines : [];
const sectionsQueue = previousTraceState?.sectionsQueue ? previousTraceState.sectionsQueue : [];
const sectionsQueue = previousTraceState?.sectionsQueue ?? [];
for (let i = 0; i < lines.length; i += 1) {
const line = lines[i];
......
......@@ -84,7 +84,7 @@ describe('Job Log', () => {
});
});
describe('Job Log, feature flag enabled', () => {
describe('Job Log, infinitelyCollapsibleSections feature flag enabled', () => {
let wrapper;
let actions;
let state;
......
......@@ -323,7 +323,7 @@ describe('Job Store mutations, feature flag ON', () => {
});
});
describe('when it is defined', () => {
describe('when lines are defined', () => {
it('sets the parsed log ', () => {
mutations[types.RECEIVE_TRACE_SUCCESS](stateCopy, {
append: false,
......@@ -344,7 +344,7 @@ describe('Job Store mutations, feature flag ON', () => {
});
});
describe('when it is null', () => {
describe('when lines are null', () => {
it('sets the default value', () => {
mutations[types.RECEIVE_TRACE_SUCCESS](stateCopy, {
append: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment