Skip to content

Commit

Permalink
test: ✅ correct the stream graph normalisation test
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonWarrenUK committed Dec 12, 2024
1 parent 064f382 commit c5de225
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions __tests__/StreamGraph.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,15 @@ describe("StreamGraph Component", () => {
// Check that we have two traces (one for each mood)
expect(plotlyData).toHaveLength(2);

// First mood should start with height 1
// First mood should start with height 0.5
const firstMoodTrace = plotlyData[0];
expect(firstMoodTrace.y[0]).toBe(1);
expect(firstMoodTrace.y[0]).toBe(0.5);

// Second mood should start with height 0
// Second mood should start with height -0.5 to balance the graph
const secondMoodTrace = plotlyData[1];
expect(secondMoodTrace.y[0]).toBe(0);
expect(secondMoodTrace.y[0]).toBe(-0.5);

// Values should sum to 0 at any point
expect(firstMoodTrace.y[0] + secondMoodTrace.y[0]).toBe(0);
});
});

0 comments on commit c5de225

Please sign in to comment.