session-features-workflow-command.test.ts 987 B

1234567891011121314151617181920212223
  1. import { describe, expect, it } from "vitest";
  2. import { withApp, featureEntries } from "./session-features-workflow-command-fixture.js";
  3. describe("`/workflow` 展开时打 workflow_cmd", () => {
  4. it("首轮就是 `/workflow`:打点先于会话落盘,entry 由首次持久化补写", async () => {
  5. await withApp({ dynamicWorkflowEnabled: true }, async ({ app, seen, sessionStore }) => {
  6. await app.submitPrompt("/workflow ship it");
  7. expect(seen).toEqual([["workflow_cmd"]]);
  8. expect(await featureEntries(sessionStore, app.sessionId)).toEqual([
  9. { features: ["workflow_cmd"] },
  10. ]);
  11. });
  12. });
  13. it("灰度关闭时命令不展开,也不打标签", async () => {
  14. await withApp({ dynamicWorkflowEnabled: false }, async ({ app, seen, sessionStore }) => {
  15. await app.submitPrompt("/workflow ship it");
  16. expect(seen).toEqual([undefined]);
  17. expect(await featureEntries(sessionStore, app.sessionId)).toEqual([]);
  18. });
  19. });
  20. });