mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
More ViewModel cleanup (#116)
This commit is contained in:
@@ -4,8 +4,9 @@ import * as ViewModels from "../Contracts/ViewModels";
|
||||
import { IPinnedRepo, JunoClient, IGalleryItem } from "./JunoClient";
|
||||
import { config } from "../Config";
|
||||
import { getAuthorizationHeader } from "../Utils/AuthorizationUtils";
|
||||
import { DatabaseAccount } from "../Contracts/DataModels";
|
||||
|
||||
const sampleDatabaseAccount: ViewModels.DatabaseAccount = {
|
||||
const sampleDatabaseAccount: DatabaseAccount = {
|
||||
id: "id",
|
||||
name: "name",
|
||||
location: "location",
|
||||
@@ -51,7 +52,7 @@ const sampleGalleryItems: IGalleryItem[] = [
|
||||
];
|
||||
|
||||
describe("Pinned repos", () => {
|
||||
const junoClient = new JunoClient(ko.observable<ViewModels.DatabaseAccount>(sampleDatabaseAccount));
|
||||
const junoClient = new JunoClient(ko.observable<DatabaseAccount>(sampleDatabaseAccount));
|
||||
|
||||
beforeEach(() => {
|
||||
window.fetch = jest.fn().mockImplementation(() => {
|
||||
@@ -88,7 +89,7 @@ describe("Pinned repos", () => {
|
||||
});
|
||||
|
||||
describe("GitHub", () => {
|
||||
const junoClient = new JunoClient(ko.observable<ViewModels.DatabaseAccount>(sampleDatabaseAccount));
|
||||
const junoClient = new JunoClient(ko.observable<DatabaseAccount>(sampleDatabaseAccount));
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
@@ -147,7 +148,7 @@ describe("GitHub", () => {
|
||||
});
|
||||
|
||||
describe("Gallery", () => {
|
||||
const junoClient = new JunoClient(ko.observable<ViewModels.DatabaseAccount>(sampleDatabaseAccount));
|
||||
const junoClient = new JunoClient(ko.observable<DatabaseAccount>(sampleDatabaseAccount));
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ko from "knockout";
|
||||
import { HttpStatusCodes } from "../Common/Constants";
|
||||
import { config } from "../Config";
|
||||
import * as ViewModels from "../Contracts/ViewModels";
|
||||
import * as DataModels from "../Contracts/DataModels";
|
||||
import { AuthorizeAccessComponent } from "../Explorer/Controls/GitHub/AuthorizeAccessComponent";
|
||||
import { IGitHubResponse } from "../GitHub/GitHubClient";
|
||||
import { IGitHubOAuthToken } from "../GitHub/GitHubOAuthService";
|
||||
@@ -55,7 +55,7 @@ interface IPublishNotebookRequest {
|
||||
export class JunoClient {
|
||||
private cachedPinnedRepos: ko.Observable<IPinnedRepo[]>;
|
||||
|
||||
constructor(private databaseAccount?: ko.Observable<ViewModels.DatabaseAccount>) {
|
||||
constructor(private databaseAccount?: ko.Observable<DataModels.DatabaseAccount>) {
|
||||
this.cachedPinnedRepos = ko.observable<IPinnedRepo[]>([]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user