Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 12, 2021
1 parent 2fd6408 commit bda1b54
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/run/preview/combination.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export const startCombinationPreview = async function (
return
}

const combinationName = getCombinationNameColor(combination)
const combinationNameColor = getCombinationNameColor(combination)
// eslint-disable-next-line fp/no-mutating-assign
Object.assign(previewState, {
combinationStart: now(),
combinationEnd: undefined,
previewSamples: 0,
index,
combinationName,
combinationNameColor,
description: START_DESCRIPTION,
})
await updatePreview(previewState)
Expand Down
4 changes: 2 additions & 2 deletions src/run/preview/results/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const updateReport = async function ({
percentage,
index,
total,
combinationName,
combinationNameColor,
reporters,
titles,
result,
Expand All @@ -77,7 +77,7 @@ export const updateReport = async function ({
percentage,
index: index + 1,
total,
combinationName,
combinationNameColor,
}
const resultB = { ...resultA, preview }
// eslint-disable-next-line fp/no-mutation, no-param-reassign
Expand Down
2 changes: 1 addition & 1 deletion src/run/preview/start_end/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getPreviewState = function ({ reporters, titles }) {
durationLeft: EMPTY_DURATION_LEFT,
percentage: 0,
index: 0,
combinationName: '',
combinationNameColor: '',
description: START_DESCRIPTION,
actions: [],
scrollTop: 0,
Expand Down
4 changes: 2 additions & 2 deletions src/run/preview/update/bottom_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getBottomBar = function ({
report,
index,
total,
combinationName,
combinationNameColor,
description,
reporters: [
{
Expand All @@ -27,7 +27,7 @@ export const getBottomBar = function ({
const counterRow = getCounterRow({
index,
total,
combinationName,
combinationNameColor,
description,
leftWidth,
})
Expand Down
12 changes: 6 additions & 6 deletions src/run/preview/update/counter.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { noteColor, titleColor } from '../../../report/utils/colors.js'
import { noteColor } from '../../../report/utils/colors.js'

// Retrieve row with combination name and counter
export const getCounterRow = function ({
index,
total,
combinationName,
combinationNameColor,
description,
leftWidth,
}) {
const counter = getCounter(index, total).padEnd(leftWidth)
const descriptionA = getDescription(description, combinationName)
return `${counter}${titleColor(combinationName)}${descriptionA}\n`
const descriptionA = getDescription(description, combinationNameColor)
return `${counter}${combinationNameColor}${descriptionA}\n`
}

// The `counter` is between `durationLeft` and `progressBar` so that there is
Expand All @@ -19,12 +19,12 @@ export const getCounter = function (index, total) {
return `(${index + 1}/${total})`
}

const getDescription = function (description, combinationName) {
const getDescription = function (description, combinationNameColor) {
if (description === '') {
return ''
}

const descriptionA =
combinationName === '' ? description : ` (${description})`
combinationNameColor === '' ? description : ` (${description})`
return noteColor(descriptionA)
}

0 comments on commit bda1b54

Please sign in to comment.