1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

Added unit tests for filters.

This commit is contained in:
Kevan Ahlquist 2015-01-04 20:35:47 -06:00
parent 275d771ea9
commit 1784719047
4 changed files with 161 additions and 5 deletions

View file

@ -1,4 +1,4 @@
angular.module('dockerui.filters', [])
angular.module('<%= pkg.name %>.filters', [])
.filter('truncate', function() {
'use strict';
return function(text, length, end) {
@ -7,14 +7,14 @@ angular.module('dockerui.filters', [])
}
if (end === undefined){
end = "...";
end = '...';
}
if (text.length <= length || text.length - end.length <= length) {
return text;
}
else {
return String(text).substring(0, length-end.length) + end;
return String(text).substring(0, length - end.length) + end;
}
};
})

View file

@ -1,4 +1,4 @@
angular.module('dockerui.services', ['ngResource'])
angular.module('<%= pkg.name %>.services', ['ngResource'])
.factory('Container', function($resource, Settings) {
'use strict';
// Resource for interacting with the docker containers