mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-28 13:21:42 +00:00
* 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
25 lines
739 B
TypeScript
25 lines
739 B
TypeScript
import AuthHeadersUtil from "../Platform/Hosted/Authorization";
|
|
import * as UserUtils from "./UserUtils";
|
|
|
|
describe("UserUtils", () => {
|
|
it("getFullName works in regular data explorer (inside portal)", () => {
|
|
const user: AuthenticationContext.UserInfo = {
|
|
userName: "userName",
|
|
profile: {
|
|
name: "name"
|
|
}
|
|
};
|
|
AuthHeadersUtil.getCachedUser = jest.fn().mockReturnValue(user);
|
|
|
|
expect(UserUtils.getFullName()).toBe("name");
|
|
});
|
|
|
|
it("getFullName works in fullscreen data explorer (outside portal)", () => {
|
|
jest.mock("./AuthorizationUtils", () => {
|
|
(): { name: string } => ({ name: "name" });
|
|
});
|
|
|
|
expect(UserUtils.getFullName()).toBe("name");
|
|
});
|
|
});
|