Skip to content

Commit bda42f7

Browse files
authored
test(config): lock in .gittensory.yml import fidelity for config-generator (#2212) (#4640)
Locks in that the config-generator's 'import existing .gittensory.yml into the form' reads an operator's file back through parseFocusManifestContent with a multi-section config's values (gate + review + settings.autonomy) round-tripping faithfully — not merely parsing without warnings. Test-only, single file. Closes #2212
1 parent 3886c18 commit bda42f7

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

test/unit/config-templates.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,29 @@ describe("config/examples review templates (#1682)", () => {
234234
expect(resolveAutonomy(on.settings.autonomy, "merge")).toBe("auto");
235235
expect(resolveAutonomy(on.settings.autonomy, "close")).toBe("observe"); // unset action ⇒ default
236236
});
237+
it("imports an existing .gittensory.yml's field values across sections into the parsed manifest (#2212)", () => {
238+
// The config-generator's "import existing .gittensory.yml into the form" reads an operator's file back
239+
// through the same parser; lock in that a multi-section config's values round-trip faithfully (not just
240+
// that it parses without warnings).
241+
const yml = [
242+
"gate:",
243+
" enabled: true",
244+
" linkedIssue: block",
245+
"review:",
246+
" inline_comments: true",
247+
" exclude_paths:",
248+
" - dist/**",
249+
"settings:",
250+
" autonomy:",
251+
" review: suggest",
252+
].join("\n");
253+
const imported = parseFocusManifestContent(yml, "repo_file");
254+
expect(imported.warnings).toEqual([]);
255+
expect(imported.present).toBe(true);
256+
expect(imported.gate.enabled).toBe(true);
257+
expect(imported.gate.linkedIssue).toBe("block");
258+
expect(imported.review.inlineComments).toBe(true);
259+
expect(imported.review.excludePaths).toEqual(["dist/**"]);
260+
expect(resolveAutonomy(imported.settings.autonomy, "review")).toBe("suggest");
261+
});
237262
});

0 commit comments

Comments
 (0)