Skip to content
Extraits de code Groupes Projets
Valider 329a2930 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #4691 added more test cases

parent 7c1a73db
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -5,21 +5,38 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe('startFrom Filter Test', function() {
var $filter;
describe('startFromFilter filter', function() {
var startFrom;
beforeEach(function() {
module('piwikApp.filter');
inject(function($injector) {
$filter = $injector.get('$filter');
var $filter = $injector.get('$filter');
startFrom = $filter('startFrom');
});
});
it('should fetch all websites', function() {
var startFrom = $filter('startFrom');
describe('startFrom', function() {
var result = startFrom([1,2,3], 2);
it('should return all entries if index is zero', function() {
expect(result).to.eql([3]);
var result = startFrom([1,2,3], 0);
expect(result).to.eql([1,2,3]);
});
it('should return only partial entries if filter is higher than zero', function() {
var result = startFrom([1,2,3], 2);
expect(result).to.eql([3]);
});
it('should return no entries if start is higher than input length', function() {
var result = startFrom([1,2,3], 11);
expect(result).to.eql([]);
});
});
});
\ No newline at end of file
......@@ -15,7 +15,7 @@ if [ -n "$TEST_SUITE" ]
then
if [ "$TEST_SUITE" = "AngularJSTests" ]
then
sh ./../angularjs/travis.sh
sh ./../angularjs/scripts/travis.sh
elif [ "$TEST_SUITE" = "JavascriptTests" ]
then
touch ../javascript/enable_sqlite
......
......@@ -3,7 +3,7 @@
npm install .
### Ubuntu
On Ubuntu you might be able to use the `install-ubuntu.sh` script. Have a look and give it a try
On Ubuntu you might be able to use the `scripts/install-ubuntu.sh` script. Have a [look](https://github.com/piwik/piwik/blob/master/tests/angularjs/install-ubuntu.sh) and give it a try
## Used libs
MochaJS + Chai
......
DIR=`dirname $0`
cd $DIR
cd ..
./node_modules/karma/bin/karma start karma.conf.js --browsers PhantomJS --single-run
\ No newline at end of file
DIR=`dirname $0`
cd $DIR
./install-ubuntu.sh
./node_modules/karma/bin/karma start --browsers PhantomJS --single-run karma.conf.js
\ No newline at end of file
./run-once.sh
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter