feat: modernize dashboard widgets
This commit is contained in:
1 parent
f3048f4804
commit
a2763d1f6f
261 files changed
+9392
-2697
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getStockSummary } from "./component";
|
||||
|
||||
describe("stock summary", () => {
|
||||
it("returns no summary for an empty series", () => {
|
||||
expect(getStockSummary([], 10)).toBeNull();
|
||||
});
|
||||
|
||||
it("does not divide by a zero previous close", () => {
|
||||
expect(getStockSummary([0, 5], 0)).toMatchObject({
|
||||
currentPrice: 5,
|
||||
change: 5,
|
||||
changePercentage: null,
|
||||
graphValues: [50, 55],
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user