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:
parent
275d771ea9
commit
1784719047
4 changed files with 161 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue