Skip to content

Commit

Permalink
chore: update test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Dover <[email protected]>
  • Loading branch information
Scott Dover authored and Scott Dover committed Nov 14, 2024
1 parent 7115d20 commit 684cd09
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/src/connection/rest/SASContentAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,17 @@ class SASContentAdapter implements ContentAdapter {
}

public async getChildItems(parentItem: ContentItem): Promise<ContentItem[]> {
try {
const { data: result } = await this.connection.get(

Check failure on line 113 in client/src/connection/rest/SASContentAdapter.ts

View workflow job for this annotation

GitHub Actions / build

'result' is assigned a value but never used
await this.generatedMembersUrlForParentItem(parentItem),
);
} catch (e) {

Check failure on line 116 in client/src/connection/rest/SASContentAdapter.ts

View workflow job for this annotation

GitHub Actions / build

'e' is defined but never used
throw new Error(await this.generatedMembersUrlForParentItem(parentItem));
}
const { data: result } = await this.connection.get(
await this.generatedMembersUrlForParentItem(parentItem),
);

if (!result.items) {
return Promise.reject();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,16 @@ describe("ContentDataProvider", async function () {
status: 409,
},
});
axiosInstance.get
.withArgs(
"uri://myFavorites/members?limit=1000000&filter=in(contentType,'file','dataFlow','RootFolder','folder','myFolder','favoritesFolder','userFolder','userRoot','trashFolder')&sortBy=eq(contentType,'folder'):descending,name:primary:ascending,type:ascending",
)
.resolves({ data: { items: [] } });
axiosInstance.get
.withArgs(
"uri://test/members?limit=1000000&filter=in(contentType,'file','dataFlow','RootFolder','folder','myFolder','favoritesFolder','userFolder','userRoot','trashFolder')&sortBy=eq(contentType,'folder'):descending,name:primary:ascending,type:ascending",
)
.resolves({ data: [] });

const dataProvider = createDataProvider();

Expand Down Expand Up @@ -483,6 +493,16 @@ describe("ContentDataProvider", async function () {
data: { ...origItem, name: "new-file.sas" },
headers: { etag: "1234", "last-modified": "5678" },
});
axiosInstance.get
.withArgs(
"uri://myFavorites/members?limit=1000000&filter=in(contentType,'file','dataFlow','RootFolder','folder','myFolder','favoritesFolder','userFolder','userRoot','trashFolder')&sortBy=eq(contentType,'folder'):descending,name:primary:ascending,type:ascending",
)
.resolves({ data: { items: [] } });
axiosInstance.get
.withArgs(
"uri://rename/members?limit=1000000&filter=in(contentType,'file','dataFlow','RootFolder','folder','myFolder','favoritesFolder','userFolder','userRoot','trashFolder')&sortBy=eq(contentType,'folder'):descending,name:primary:ascending,type:ascending",
)
.resolves({ data: { items: [] } });

const dataProvider = createDataProvider();

Expand Down Expand Up @@ -521,6 +541,16 @@ describe("ContentDataProvider", async function () {
data: referencedFile,
headers: { etag: "1234", "last-modified": "5678" },
});
axiosInstance.get
.withArgs(
"uri://myFavorites/members?limit=1000000&filter=in(contentType,'file','dataFlow','RootFolder','folder','myFolder','favoritesFolder','userFolder','userRoot','trashFolder')&sortBy=eq(contentType,'folder'):descending,name:primary:ascending,type:ascending",
)
.resolves({ data: { items: [] } });
axiosInstance.get
.withArgs(
"uri://test/members?limit=1000000&filter=in(contentType,'file','dataFlow','RootFolder','folder','myFolder','favoritesFolder','userFolder','userRoot','trashFolder')&sortBy=eq(contentType,'folder'):descending,name:primary:ascending,type:ascending",
)
.resolves({ data: { items: [] } });

await dataProvider.connect("http://test.io");
const uri: Uri = await dataProvider.renameResource(
Expand Down

0 comments on commit 684cd09

Please sign in to comment.