ui.bootstrap.pagination for list, cleanup
[angular-drzb] / test / unit / directivesSpec.js
1 'use strict';
2
3 /* jasmine specs for directives go here */
4
5 describe('directives', function() {
6   beforeEach(module('myApp.directives'));
7
8   describe('app-version', function() {
9     it('should print current version', function() {
10       module(function($provide) {
11         $provide.value('version', 'TEST_VER');
12       });
13       inject(function($compile, $rootScope) {
14         var element = $compile('<span app-version></span>')($rootScope);
15         expect(element.text()).toEqual('TEST_VER');
16       });
17     });
18   });
19
20   describe('my-input', function() {
21     it('div+label+input', function() {
22       inject(function($compile, $rootScope) {
23         var element = $compile('<div><input class="my-input" ng-model="m" placeholder="p"></input></div>')($rootScope);
24 //              dump(element.html());
25 //              console.log( element );
26         expect(element.html()).toMatch(/div.*label.*input.*div/i);
27       });
28     });
29   });
30
31   describe('my-label-input', function() {
32     it('div+label+input', function() {
33       inject(function($compile, $rootScope) {
34         var element = $compile('<div><input class="my-label-input" ng-model="m" placeholder="p" label="label"></input></div>')($rootScope);
35         expect(element.html()).toMatch(/div.*label/i);
36       });
37     });
38   });
39
40   describe('my-label-select', function() {
41     beforeEach(module('myApp.services'));
42     it('div+label+input', function() {
43       inject(function($compile, $rootScope, RegistrationState) {
44                 //dump( RegistrationState() );
45         var element = $compile('<div><select class="my-label-select" ng-model="m" label="label" ng-options="value for value in RegistrationState()"></select></div>')($rootScope);
46                 //dump(element.html());
47         expect(element.html()).toMatch(/div.*label.*label.*div.*select.*select.*div.*div/i);
48       });
49     });
50   });
51
52 });