Keep the template picker in the create flow, make catalog cards real links, and stop showing a fake community when review has no draft.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,14 +7,12 @@ import {
|
||||
isValidStep,
|
||||
getStepIndex,
|
||||
parseReviewReturnSearchParam,
|
||||
parseCreateFlowScreenFromPathname,
|
||||
resolveCreateFlowBackTarget,
|
||||
shouldOfferCreateFlowSaveAndExit,
|
||||
isDirectTemplateReviewEntry,
|
||||
isCreateFlowTemplatesPickerPath,
|
||||
createFlowStepUsesSelectSplitScroll,
|
||||
TEMPLATES_FACET_RECOMMEND_QUERY,
|
||||
TEMPLATES_FACET_RECOMMEND_VALUE,
|
||||
TEMPLATE_REVIEW_FROM_CREATE_FLOW_QUERY,
|
||||
TEMPLATE_REVIEW_FROM_CREATE_FLOW_VALUE,
|
||||
} from "../../app/(app)/create/utils/flowSteps";
|
||||
|
||||
describe("flowSteps", () => {
|
||||
@@ -158,10 +156,23 @@ describe("flowSteps", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("review Create from template uses fromFlow and recommendTemplates together", () => {
|
||||
it("isCreateFlowTemplatesPickerPath is true only for /create/templates", () => {
|
||||
expect(isCreateFlowTemplatesPickerPath("/create/templates")).toBe(true);
|
||||
expect(isCreateFlowTemplatesPickerPath("/create/templates/")).toBe(true);
|
||||
expect(isCreateFlowTemplatesPickerPath("/create/review-template/consensus")).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isCreateFlowTemplatesPickerPath("/templates")).toBe(false);
|
||||
expect(isCreateFlowTemplatesPickerPath("/create/review")).toBe(false);
|
||||
expect(isCreateFlowTemplatesPickerPath(null)).toBe(false);
|
||||
});
|
||||
|
||||
it("parseCreateFlowScreenFromPathname ignores template auxiliary routes", () => {
|
||||
expect(parseCreateFlowScreenFromPathname("/create/review")).toBe("review");
|
||||
expect(parseCreateFlowScreenFromPathname("/create/templates")).toBeNull();
|
||||
expect(
|
||||
`/templates?${TEMPLATE_REVIEW_FROM_CREATE_FLOW_QUERY}=${TEMPLATE_REVIEW_FROM_CREATE_FLOW_VALUE}&${TEMPLATES_FACET_RECOMMEND_QUERY}=${TEMPLATES_FACET_RECOMMEND_VALUE}`,
|
||||
).toBe("/templates?fromFlow=1&recommendTemplates=1");
|
||||
parseCreateFlowScreenFromPathname("/create/review-template/consensus"),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("parseReviewReturnSearchParam accepts only final-review and edit-rule", () => {
|
||||
|
||||
Reference in New Issue
Block a user