diff --git a/app/api/files.js b/app/api/files.js index c7a810b..6a5a21c 100644 --- a/app/api/files.js +++ b/app/api/files.js @@ -38,7 +38,8 @@ function canvasResponseHandler(request, response, canvasResponse) { folderId: file.folder_id, iframeUrl: file.embedded_iframe_url, thumbnailUrl: file.thumbnail_url || file.url, - category: file.category + category: file.category, + mediaEntryId: file.media_entry_id }; }), bookmark: packageBookmark(request, canvasResponse.bookmark) diff --git a/test/service/api/files.test.js b/test/service/api/files.test.js index d117ce0..632fed0 100644 --- a/test/service/api/files.test.js +++ b/test/service/api/files.test.js @@ -115,7 +115,8 @@ describe("Files API", () => { folder_id: 1, embedded_iframe_url: "https://canvas.com/foo/bar", thumbnail_url: "https://canvas.com/foo/bar/thumbnail", - category: "foo" + category: "foo", + media_entry_id: "bar" }; }); @@ -139,7 +140,8 @@ describe("Files API", () => { folderId: 1, iframeUrl: "https://canvas.com/foo/bar", thumbnailUrl: "someurl", - category: "foo" + category: "foo", + mediaEntryId: "bar" }); }); }); @@ -156,6 +158,7 @@ describe("Files API", () => { }); it("files have correctly tranformed properties", () => { + file.media_entry_id = null; canvasResponse.body = [file]; canvasResponse.statusCode = 200; canvasResponseHandler(request, response, canvasResponse); @@ -170,7 +173,8 @@ describe("Files API", () => { folderId: 1, iframeUrl: "https://canvas.com/foo/bar", thumbnailUrl: "https://canvas.com/foo/bar/thumbnail", - category: "foo" + category: "foo", + mediaEntryId: null }); });