summaryrefslogtreecommitdiffstats
path: root/src/test/javascript/demo.test.js
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2018-10-16 17:47:54 +0200
committersebdet <sebastien.determe@intl.att.com>2018-10-22 09:31:31 +0200
commite442200bcfed06d52821ec735850ad817ef69dfc (patch)
tree022a360f7e36bff30c17dd8174f879b4fc5ec994 /src/test/javascript/demo.test.js
parent78fd76a76a1ba19fea56ca33b6d700e365b9d508 (diff)
Add javascript test
Add first javascript test and Jest Framework to execute the javascript testing on the clamp UI Issue-ID: CLAMP-235 Change-Id: Ie3475ebf450d0d7d4cd01de9c04eed44176932a2 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/test/javascript/demo.test.js')
-rw-r--r--src/test/javascript/demo.test.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/test/javascript/demo.test.js b/src/test/javascript/demo.test.js
new file mode 100644
index 00000000..c088957f
--- /dev/null
+++ b/src/test/javascript/demo.test.js
@@ -0,0 +1,53 @@
+require('jquery/dist/jquery.min.js');
+require('angular/angular.min.js');
+require('angular-mocks/angular-mocks.js');
+require('angular-route/angular-route.min.js');
+require('angular-resource/angular-resource.min.js');
+require('angular-cookies/angular-cookies.min.js');
+require('angular-animate/angular-animate.min.js');
+require('angular-sanitize/angular-sanitize.min.js');
+require('angular-touch/angular-touch.min.js');
+require('popper.js/dist/umd/popper.min.js');
+require('bootstrap/dist/js/bootstrap.min.js');
+require('angular-ui-bootstrap/dist/ui-bootstrap-tpls.js');
+require('angular-loading-bar/src/loading-bar.js');
+require('angular-dialog-service/dist/dialogs.js');
+require('scripts/app.js');
+require('scripts/DashboardCtrl.js');
+
+
+describe('Dashboard ctrl tests', function() {
+
+ beforeEach(angular.mock.module('clds-app'));
+
+ var $controllerService;
+
+ beforeEach(angular.mock.inject(function(_$controller_) {
+ $controllerService = _$controller_;
+ }));
+
+ describe('$scope.showPalette', function() {
+
+ it('test showPalette', function() {
+
+ var $scopeTest = {};
+ var $rootScopeTest = {};
+ var $resourceTest = {};
+ var $httpTest = {};
+ var $timeoutTest = {};
+ var $locationTest = {};
+ var $intervalTest = function(){};
+ var $controllerDashboard = $controllerService('DashboardCtrl', {
+ '$scope' : $scopeTest,
+ '$rootScope' : $rootScopeTest,
+ '$resource' : $resourceTest,
+ '$http' : $httpTest,
+ '$timeout' : $timeoutTest,
+ '$location' : $locationTest,
+ '$interval' : $intervalTest
+ });
+ $scopeTest.showPalette();
+ expect($rootScopeTest.isModel).toEqual(true);
+ });
+ });
+}); \ No newline at end of file