Skip to content

Commit

Permalink
✅ test: update matrix renderer assertion
Browse files Browse the repository at this point in the history
The test now correctly verifies the final fillStyle state after drawing
operations complete, matching the actual render sequence in the matrix animation.
  • Loading branch information
w3bdesign committed Feb 7, 2025
1 parent c9abc8b commit fc4c989
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/__tests__/Animations/Matrix.renderer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ describe("Matrix Renderer", () => {
renderer.draw();

// Assert
// The fillStyle should be set to the font color after drawing is complete
// since that's the last operation
expect(mockCtx.fillRect).toHaveBeenCalledWith(0, 0, 100, 100);
expect(mockCtx.font).toBe(expectedFont);
expect(mockCtx.fillStyle).toBe(`rgba(0, 0, 0, 0.5)`);
expect(mockCtx.fillStyle).toBe(`rgb(${rgbFont.r}, ${rgbFont.g}, ${rgbFont.b})`);
});

it("draws columns with characters", () => {
Expand Down

0 comments on commit fc4c989

Please sign in to comment.