feat: support unassigned purchases and allocation status
Allow month-only purchases to start finance plans. Keep unbudgeted posts distinct from explicit zero rules in overspend reporting.
This commit is contained in:
@@ -53,6 +53,11 @@ describe("round trip", () => {
|
||||
});
|
||||
|
||||
describe("validation", () => {
|
||||
test("accepts a purchase with no post and preserves it through export", () => {
|
||||
const data = populated();
|
||||
data.purchases[0]!.splits = [];
|
||||
expect(parseDatasetJson(exportDatasetJson(data)).purchases[0]!.splits).toEqual([]);
|
||||
});
|
||||
test("rejects malformed JSON", () => {
|
||||
expect(() => parseDatasetJson("{not json")).toThrow(ImportValidationError);
|
||||
});
|
||||
@@ -89,12 +94,6 @@ describe("validation", () => {
|
||||
expect(() => parseDatasetJson(JSON.stringify(data))).toThrow(/exactly one/i);
|
||||
});
|
||||
|
||||
test("rejects a purchase with no splits", () => {
|
||||
const data = populated();
|
||||
data.purchases[0]!.splits = [];
|
||||
expect(() => parseDatasetJson(JSON.stringify(data))).toThrow(/at least one split/i);
|
||||
});
|
||||
|
||||
test("rejects an unsupported currency", () => {
|
||||
const data = populated() as any;
|
||||
// CHF, not GBP: GBP is one of the currencies the app ships with now.
|
||||
|
||||
Reference in New Issue
Block a user