Skip to content

Commit

Permalink
Red test on first x value of CFD
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-mk committed Nov 24, 2023
1 parent 0ffb485 commit 18b73fa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jira-related/jira-service-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function itemIsTransitionToInProgress(item: any): boolean {
return itemComesFromToDo(item) && itemGoesToInProgress(item)
}

interface StateWithDate {
export interface StateWithDate {
stateName: string,
stateReachedDate: Date
}
Expand Down
13 changes: 12 additions & 1 deletion src/plotting/plotting-functions.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { describe, expect, test } from "bun:test";
import { createPlotDataForPercentages as createPlotDataForPercentages, createPlotDataFromCycleTimeHistogram, valuesSummedUp } from "./plotting-functions";
import { createPlotDataForCfd, createPlotDataForPercentages as createPlotDataForPercentages, createPlotDataFromCycleTimeHistogram, valuesSummedUp } from "./plotting-functions";
import { CycleTimeHistogramEntry } from "../core/core-functions";
import * as _ from "lodash"
import { Plot } from "nodeplotlib";
import { Issue } from "../core/core-interfaces";
import { StateWithDate } from "../jira-related/jira-service-functions";

describe("createPlotDataFromCycleTimeHistogram()", () => {
const input: CycleTimeHistogramEntry[] = [{
Expand Down Expand Up @@ -82,3 +84,12 @@ describe("createPlotDataForPercentages()", () => {
})
})

describe("createDataForCfd()", () => {
const issues: Issue[] = []
const statesWithDates: StateWithDate[] = []
const result = createPlotDataForCfd(issues, statesWithDates)

test("it should have '2023-10-30' as the first x value", () => {
expect(result.x![0]).toEqual("2023-10-30")

Check failure on line 93 in src/plotting/plotting-functions.test.ts

View workflow job for this annotation

GitHub Actions / Run tests

error: expect(received).toEqual(expected)

Expected: "2023-10-30" Received: undefined at /home/runner/work/hack-jira-cfd/hack-jira-cfd/src/plotting/plotting-functions.test.ts:93:8
})
})
11 changes: 11 additions & 0 deletions src/plotting/plotting-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as _ from "lodash";
import { CycleTimeHistogramEntry } from "../core/core-functions";
import { plot, Plot, Layout } from "nodeplotlib"
import { cumsum } from "mathjs";
import { StateWithDate } from "../jira-related/jira-service-functions";
import { Issue } from "../core/core-interfaces";

export function createPlotDataFromCycleTimeHistogram(cycleTimeHistogram: CycleTimeHistogramEntry[]): Plot {
const xValues = cycleTimeHistogram.map(entry => entry.numberOfDays)
Expand Down Expand Up @@ -32,4 +34,13 @@ export function createPlotDataForPercentages(cycleTimeHistogram: CycleTimeHistog
export function valuesSummedUp(values: number[]): number[] {
const cumulativeSum = cumsum(values)
return <number[]>cumsum(values)
}

export function createPlotDataForCfd(issues: Issue[], statesWithDates: StateWithDate[]): Plot {
const result: Plot = {
x: [],
y: []
}

return result
}

0 comments on commit 18b73fa

Please sign in to comment.