my-input
[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       module(function($provide) {
23         $provide.value('version', 'TEST_VER');
24       });
25       inject(function($compile, $rootScope) {
26         var element = $compile('<div><input class="my-input" ng-model="m" placeholder="p"></input></div>')($rootScope);
27                 dump(element.html());
28                 console.log( element );
29         expect(element.html()).toMatch(/div.*label.*input.*div/);
30       });
31     });
32   });
33 });