Copilot commented on code in PR #6781:
URL: https://github.com/apache/texera/pull/6781#discussion_r3627936648
##########
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:
This test name is misleading: the mocked AuthService.getAccessToken()
returns null, so initialize() is actually exercising the `?? ""` fallback to an
empty string rather than “falling back to the access token”. Renaming the test
will make the intent clearer and reduce confusion when reading failures.
--
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]