mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-26 22:11:20 -07:00
20 lines
534 B
JavaScript
20 lines
534 B
JavaScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
|
|
|
import widget from "./widget";
|
|
|
|
describe("miniflux widget config", () => {
|
|
it("exports a valid widget config", () => {
|
|
expectWidgetConfigShape(widget);
|
|
});
|
|
|
|
it("sums read and unread counters", () => {
|
|
const result = widget.mappings.counters.map(
|
|
Buffer.from(JSON.stringify({ reads: { 1: 2, 2: 3 }, unreads: { 1: 4, 2: 1 } })),
|
|
);
|
|
|
|
expect(result).toEqual({ read: 5, unread: 5 });
|
|
});
|
|
});
|