Fix asserts silently not executed
The first parameter of "apply" must be the object to act as "this", and the Promise callback gets the parameters provided in the "resolve". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
c047f32f25
commit
e2c755a4b5
|
@ -640,14 +640,14 @@ describe('OC.Files.Client tests', function() {
|
||||||
|
|
||||||
function testPermission(permission, isFile, expectedPermissions) {
|
function testPermission(permission, isFile, expectedPermissions) {
|
||||||
var promise = getFileInfoWithPermission(permission, isFile);
|
var promise = getFileInfoWithPermission(permission, isFile);
|
||||||
promise.then(function(result) {
|
promise.then(function(status, result) {
|
||||||
expect(result.permissions).toEqual(expectedPermissions);
|
expect(result.permissions).toEqual(expectedPermissions);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function testMountType(permission, isFile, expectedMountType) {
|
function testMountType(permission, isFile, expectedMountType) {
|
||||||
var promise = getFileInfoWithPermission(permission, isFile);
|
var promise = getFileInfoWithPermission(permission, isFile);
|
||||||
promise.then(function(result) {
|
promise.then(function(status, result) {
|
||||||
expect(result.mountType).toEqual(expectedMountType);
|
expect(result.mountType).toEqual(expectedMountType);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -664,7 +664,7 @@ describe('OC.Files.Client tests', function() {
|
||||||
['CKWDR', true, OC.PERMISSION_ALL]
|
['CKWDR', true, OC.PERMISSION_ALL]
|
||||||
];
|
];
|
||||||
_.each(testCases, function(testCase) {
|
_.each(testCases, function(testCase) {
|
||||||
return testPermission.apply(testCase);
|
return testPermission.apply(this, testCase);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('properly parses folder permissions', function() {
|
it('properly parses folder permissions', function() {
|
||||||
|
@ -679,7 +679,7 @@ describe('OC.Files.Client tests', function() {
|
||||||
];
|
];
|
||||||
|
|
||||||
_.each(testCases, function(testCase) {
|
_.each(testCases, function(testCase) {
|
||||||
return testPermission.apply(testCase);
|
return testPermission.apply(this, testCase);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('properly parses mount types', function() {
|
it('properly parses mount types', function() {
|
||||||
|
@ -691,7 +691,7 @@ describe('OC.Files.Client tests', function() {
|
||||||
];
|
];
|
||||||
|
|
||||||
_.each(testCases, function(testCase) {
|
_.each(testCases, function(testCase) {
|
||||||
return testMountType.apply(testCase);
|
return testMountType.apply(this, testCase);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue