mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 09:02:41 +01:00
b7caca1cd6
Removes the GitHub notebook-repo integration that only existed to pin/browse notebook repositories. Deletes src/GitHub/, the GitHub controls/panes, GitHubUtils, JunoUtils, and the connectToGitHub webpack entry. Decouples NotebookManager, useNotebook, the resource tree, and Explorer from GitHub wiring. Trims JunoClient's GitHub-only methods while keeping the Schema and gallery methods. Removes GitHub config fields from ConfigContext and strips the dead github:// branches from NotebookUtil. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { NotebookUtil } from "./NotebookUtil";
|
|
|
|
const fileName = "file";
|
|
const notebookName = "file.ipynb";
|
|
const folderPath = "folder";
|
|
const filePath = `${folderPath}/${fileName}`;
|
|
const notebookPath = `${folderPath}/${notebookName}`;
|
|
|
|
describe("NotebookUtil", () => {
|
|
describe("isNotebookFile", () => {
|
|
it("works for jupyter file paths", () => {
|
|
expect(NotebookUtil.isNotebookFile(filePath)).toBeFalsy();
|
|
expect(NotebookUtil.isNotebookFile(notebookPath)).toBeTruthy();
|
|
});
|
|
});
|
|
|
|
describe("getFilePath", () => {
|
|
it("works for jupyter file paths", () => {
|
|
expect(NotebookUtil.getFilePath(folderPath, fileName)).toEqual(filePath);
|
|
});
|
|
});
|
|
|
|
describe("getParentPath", () => {
|
|
it("works for jupyter file paths", () => {
|
|
expect(NotebookUtil.getParentPath(filePath)).toEqual(folderPath);
|
|
});
|
|
});
|
|
|
|
describe("getName", () => {
|
|
it("works for jupyter file paths", () => {
|
|
expect(NotebookUtil.getName(filePath)).toEqual(fileName);
|
|
expect(NotebookUtil.getName(notebookPath)).toEqual(notebookName);
|
|
});
|
|
});
|
|
|
|
describe("replaceName", () => {
|
|
it("works for jupyter file paths", () => {
|
|
expect(NotebookUtil.replaceName(filePath, "newName")).toEqual(filePath.replace(fileName, "newName"));
|
|
expect(NotebookUtil.replaceName(notebookPath, "newName")).toEqual(notebookPath.replace(notebookName, "newName"));
|
|
});
|
|
});
|
|
});
|