Merge "Make text download and load groups tests work"
This commit is contained in:
commit
e3dd5a02d9
horizon/static/framework/util/file
openstack_dashboard/dashboards/identity/static/dashboard/identity/groups
@ -23,12 +23,14 @@
|
||||
$scope = $injector.get('$rootScope');
|
||||
}));
|
||||
|
||||
it('should return promise and it resolve filename after starting download file', function() {
|
||||
it('should return a promise that resolves to a download file name', inject(function($timeout) {
|
||||
var promise = textDownload.downloadTextFile('content', 'download_file_name.txt');
|
||||
promise.then(verifyContents);
|
||||
$scope.$apply();
|
||||
promise.then(function(contents) {
|
||||
$timeout.flush();
|
||||
function verifyContents (contents) {
|
||||
expect(contents).toEqual('download_file_name.txt');
|
||||
});
|
||||
});
|
||||
}
|
||||
}));
|
||||
});
|
||||
})();
|
||||
|
@ -50,10 +50,12 @@
|
||||
});
|
||||
|
||||
it('should load groups', function () {
|
||||
registry.getResourceType('OS::Keystone::Group').list().then(function(responses) {
|
||||
$scope.$apply();
|
||||
expect(responses).toEqual(groups);
|
||||
});
|
||||
var groupList = registry.getResourceType('OS::Keystone::Group').list();
|
||||
groupList.then(verifyResult);
|
||||
$scope.$apply();
|
||||
function verifyResult (result) {
|
||||
expect(result).toEqual(groups);
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user