fix: reject blank imported budget item names
This commit is contained in:
1 parent
c34aa846b9
commit
046ca7824e
2 files changed
+23
No files matched your search
@@ -163,6 +163,23 @@ describe("import rejects invalid folder graph", () => {
|
||||
data.posts[0]!.order = 0;
|
||||
expect(() => parse(data)).toThrow(ImportValidationError);
|
||||
});
|
||||
|
||||
test("rejects a blank post name", () => {
|
||||
const data = populated();
|
||||
data.posts[0]!.name = " ";
|
||||
expect(() => parse(data)).toThrow(ImportValidationError);
|
||||
});
|
||||
|
||||
test("rejects a blank recurring-cost name", () => {
|
||||
const data = populated();
|
||||
data.recurring.push({
|
||||
id: "rent", name: " ", order: 3, folderId: null, archived: false,
|
||||
amount: { amount: 100, currency: "DKK" }, startDate: "2026-01",
|
||||
recurrence: { kind: "everyNMonths", n: 1 }, anchoring: "calendar",
|
||||
splitMode: "percent", splits: [{ postId: data.posts[0]!.id, value: 100, absorbsRemainder: true }],
|
||||
});
|
||||
expect(() => parse(data)).toThrow(ImportValidationError);
|
||||
});
|
||||
});
|
||||
|
||||
test("describeDataset counts what an import would replace", () => {
|
||||
|
||||
Reference in new issue
Block a user