diff --git a/src/jira-related/jira-service-functions.ts b/src/jira-related/jira-service-functions.ts index 930fa7b..bcb0af4 100644 --- a/src/jira-related/jira-service-functions.ts +++ b/src/jira-related/jira-service-functions.ts @@ -44,7 +44,7 @@ function itemIsTransitionToInProgress(item: any): boolean { return itemComesFromToDo(item) && itemGoesToInProgress(item) } -interface StateWithDate { +export interface StateWithDate { stateName: string, stateReachedDate: Date } diff --git a/src/plotting/plotting-functions.test.ts b/src/plotting/plotting-functions.test.ts index 8f82793..897e28c 100644 --- a/src/plotting/plotting-functions.test.ts +++ b/src/plotting/plotting-functions.test.ts @@ -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[] = [{ @@ -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") + }) +}) \ No newline at end of file diff --git a/src/plotting/plotting-functions.ts b/src/plotting/plotting-functions.ts index f89655b..27975dc 100644 --- a/src/plotting/plotting-functions.ts +++ b/src/plotting/plotting-functions.ts @@ -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) @@ -32,4 +34,13 @@ export function createPlotDataForPercentages(cycleTimeHistogram: CycleTimeHistog export function valuesSummedUp(values: number[]): number[] { const cumulativeSum = cumsum(values) return cumsum(values) +} + +export function createPlotDataForCfd(issues: Issue[], statesWithDates: StateWithDate[]): Plot { + const result: Plot = { + x: [], + y: [] + } + + return result } \ No newline at end of file