mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 03:30:39 +09:00
Default recurring task exports to checked
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
c41dd2e393
commit
220946b2a1
3 changed files with 105 additions and 13 deletions
41
ui/src/lib/company-export-selection.test.ts
Normal file
41
ui/src/lib/company-export-selection.test.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { buildInitialExportCheckedFiles } from "./company-export-selection";
|
||||
|
||||
describe("buildInitialExportCheckedFiles", () => {
|
||||
it("checks non-task files and recurring task packages by default", () => {
|
||||
const checked = buildInitialExportCheckedFiles(
|
||||
[
|
||||
"README.md",
|
||||
".paperclip.yaml",
|
||||
"tasks/one-off/TASK.md",
|
||||
"tasks/recurring/TASK.md",
|
||||
"tasks/recurring/notes.md",
|
||||
],
|
||||
[
|
||||
{ path: "tasks/one-off/TASK.md", recurring: false },
|
||||
{ path: "tasks/recurring/TASK.md", recurring: true },
|
||||
],
|
||||
new Set<string>(),
|
||||
);
|
||||
|
||||
expect(Array.from(checked).sort()).toEqual([
|
||||
".paperclip.yaml",
|
||||
"README.md",
|
||||
"tasks/recurring/TASK.md",
|
||||
"tasks/recurring/notes.md",
|
||||
]);
|
||||
});
|
||||
|
||||
it("preserves previous manual selections for one-time tasks", () => {
|
||||
const checked = buildInitialExportCheckedFiles(
|
||||
["README.md", "tasks/one-off/TASK.md"],
|
||||
[{ path: "tasks/one-off/TASK.md", recurring: false }],
|
||||
new Set(["tasks/one-off/TASK.md"]),
|
||||
);
|
||||
|
||||
expect(Array.from(checked).sort()).toEqual([
|
||||
"README.md",
|
||||
"tasks/one-off/TASK.md",
|
||||
]);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue