Skip to content

Commit

Permalink
change test
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Jul 24, 2023
1 parent 33d6fdc commit 2c8f3cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { IConnectionDefault } from "../../../interfaces/IConnectionDefault";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import * as FetchPost from "../../../shared/fetch-post";
import { FileListCache } from "../../../shared/filelist-cache";
import { UrlQuery } from "../../../shared/url-query";
import { UpdateChange } from "./update-change";

describe("Update Change", () => {
Expand Down Expand Up @@ -165,26 +164,22 @@ describe("Update Change", () => {
expect(fetchPostSpy).toBeCalledTimes(1);
});

it("no content 2", () => {
it("no content 2", async () => {
const fetchPostSpy = jest
.spyOn(FetchPost, "default")
.mockImplementationOnce(() => {
return Promise.resolve({} as IConnectionDefault);
});

new UpdateChange(
await new UpdateChange(
{} as any,
jest.fn(),
jest.fn(),
{} as any,
{} as any
).Update([["tags", "test"]]);

expect(fetchPostSpy).toBeCalledTimes(1);
expect(fetchPostSpy).toBeCalledWith(
new UrlQuery().UrlUpdateApi(),
"tags=test"
);
expect(fetchPostSpy).toBeCalledTimes(0);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class UpdateChange {
const fileIndexObject: any = this.fileIndexItem;

if (fileIndexObject[name] === undefined) {
console.log("missing name", name);
console.error("missing name", name);
continue; //to update empty start to first fill
}

Expand Down

0 comments on commit 2c8f3cc

Please sign in to comment.