aglinxinyuan commented on code in PR #6781:
URL: https://github.com/apache/texera/pull/6781#discussion_r3628045015


##########
frontend/src/app/workspace/service/notebook-migration/migration-llm.spec.ts:
##########
@@ -304,4 +323,108 @@ describe("NotebookMigrationLLM", () => {
       expect(parse('Sure! {"a":1} hope that helps')).toEqual({ a: 1 });
     });
   });
+
+  describe("feature flag guard", () => {
+    it("initialize() throws when the migration feature is disabled", () => {
+      const llm = makeUninitializedLLM(false);
+      expect(() => llm.initialize("gpt-5-mini", 
"test-token")).toThrow("Notebook migration feature is disabled");
+    });
+
+    it("convertNotebookToWorkflow() rejects when the migration feature is 
disabled", async () => {
+      const llm = makeUninitializedLLM(false);
+      await expect(llm.convertNotebookToWorkflow({ cells: [] 
})).rejects.toThrow(
+        "Notebook migration feature is disabled"
+      );
+      // assertEnabled fails before any prompting.
+      expect(callModelSpy).not.toHaveBeenCalled();
+    });
+  });
+
+  describe("initialize", () => {
+    it("falls back to the AuthService access token when none is passed", async 
() => {

Review Comment:
   Fixed — renamed to 'defaults the access token to an empty string when 
AuthService returns null and none is passed' to reflect the ?? "" fallback.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to