Close method-card Save like first add, keep key-resource chips on the approach they were chosen for, and leave expanded See-all stacks in catalog order.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
applyDecisionApproachKeyResources,
|
||||
decisionApproachKeyResourceCheckboxIds,
|
||||
decisionApproachKeyResourceIdsFromLabels,
|
||||
decisionApproachScopeForPublish,
|
||||
decisionApproachKeyResourceItems,
|
||||
@@ -96,6 +97,37 @@ describe("decisionApproachKeyResources", () => {
|
||||
).toEqual(["amend", "project"]);
|
||||
});
|
||||
|
||||
it("derives sidebar checks from the open draft or selected approaches", () => {
|
||||
const detailsById = {
|
||||
"lazy-consensus": {
|
||||
...emptyEntry(),
|
||||
selectedApplicableScope: ["Steward finances"],
|
||||
},
|
||||
"do-ocracy": {
|
||||
...emptyEntry(),
|
||||
selectedApplicableScope: ["Project level decisions"],
|
||||
},
|
||||
};
|
||||
expect(
|
||||
decisionApproachKeyResourceCheckboxIds({
|
||||
detailsById,
|
||||
selectedApproachIds: ["lazy-consensus", "do-ocracy"],
|
||||
reminderIds: ["discipline"],
|
||||
}),
|
||||
).toEqual(["finances", "project", "discipline"]);
|
||||
expect(
|
||||
decisionApproachKeyResourceCheckboxIds({
|
||||
detailsById,
|
||||
selectedApproachIds: ["lazy-consensus", "do-ocracy"],
|
||||
reminderIds: ["discipline"],
|
||||
openDraft: {
|
||||
...emptyEntry(),
|
||||
selectedApplicableScope: ["Amend your CommunityRule"],
|
||||
},
|
||||
}),
|
||||
).toEqual(["amend"]);
|
||||
});
|
||||
|
||||
it("syncs existing and selected approach details", () => {
|
||||
const next = syncDecisionApproachKeyResourceDetails(
|
||||
{ "lazy-consensus": emptyEntry() },
|
||||
|
||||
Reference in New Issue
Block a user