forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilesController.spec.js
More file actions
29 lines (23 loc) · 898 Bytes
/
FilesController.spec.js
File metadata and controls
29 lines (23 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var FilesController = require('../src/Controllers/FilesController').FilesController;
var GridStoreAdapter = require("../src/Adapters/Files/GridStoreAdapter").GridStoreAdapter;
var Config = require("../src/Config");
// Small additional tests to improve overall coverage
describe("FilesController",()=>{
it("should properly expand objects", (done) => {
var config = new Config(Parse.applicationId);
var adapter = new GridStoreAdapter();
var filesController = new FilesController(adapter);
var result = filesController.expandFilesInObject(config, function(){});
expect(result).toBeUndefined();
var fullFile = {
type: '__type',
url: "http://an.url"
}
var anObject = {
aFile: fullFile
}
filesController.expandFilesInObject(config, anObject);
expect(anObject.aFile.url).toEqual("http://an.url");
done();
})
})