cosmos-explorer/src/Utils/JunoUtils.test.ts
Tanuj Mittal 84ea3796ec
Remove enableGallery feature flag (#68)
* Remove enableGallery feature flag

* Fix bugs

* Add tests to increase coverage

* Move favorites functionality behind feature.enableGalleryPublish flag

* Show code cells in NotebookViewer

* Use cosmos db logo as persona image for sample notebook gallery cards

* Update gallery card snapshot to fix test
2020-07-06 12:10:26 -07:00

46 lines
1021 B
TypeScript

import { RepoListItem } from "../Explorer/Controls/GitHub/GitHubReposComponent";
import { IPinnedRepo } from "../Juno/JunoClient";
import { JunoUtils } from "./JunoUtils";
import { IGitHubRepo } from "../GitHub/GitHubClient";
const gitHubRepo: IGitHubRepo = {
name: "repo-name",
owner: "owner",
private: false
};
const repoListItem: RepoListItem = {
key: "key",
repo: {
name: "repo-name",
owner: "owner",
private: false
},
branches: [
{
name: "branch-name"
}
]
};
const pinnedRepo: IPinnedRepo = {
name: "repo-name",
owner: "owner",
private: false,
branches: [
{
name: "branch-name"
}
]
};
describe("JunoUtils", () => {
it("toPinnedRepo converts RepoListItem to IPinnedRepo", () => {
expect(JunoUtils.toPinnedRepo(repoListItem)).toEqual(pinnedRepo);
});
it("toGitHubRepo converts IPinnedRepo to IGitHubRepo", () => {
expect(JunoUtils.toGitHubRepo(pinnedRepo)).toEqual(gitHubRepo);
});
});