File tree Expand file tree Collapse file tree 3 files changed +29
-34
lines changed Expand file tree Collapse file tree 3 files changed +29
-34
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ module.exports = function(config) {
2626 'src/directives/decorators/bootstrap/*.js' ,
2727 'src/**/*.html' ,
2828 'test/schema-form-test.js' ,
29- 'test/service-test.js'
29+ 'test/service-test.js' ,
30+ 'test/decorator-factory-service-test.js' ,
3031 ] ,
3132
3233 // list of files to exclude
Original file line number Diff line number Diff line change 1+ describe ( 'decorator factory service' , function ( ) {
2+ beforeEach ( module ( 'templates' ) ) ;
3+ beforeEach ( module ( 'schemaForm' ) ) ;
4+
5+ it ( 'should enable you to create new decorator directives' , function ( ) {
6+ module ( function ( schemaFormDecoratorsProvider ) {
7+ schemaFormDecoratorsProvider . createDecorator ( 'foobar' , { 'foo' :'/bar.html' } , [ angular . noop ] ) ;
8+ } ) ;
9+
10+ inject ( function ( $rootScope , $compile , $templateCache ) {
11+ $templateCache . put ( '/bar.html' , '<div class="yes">YES</div>' ) ;
12+
13+ //Since our directive does a replace we need a wrapper to actually check the content.
14+ var templateWithWrap = angular . element ( '<div id="wrap"><foobar form="{ type: \'foo\'}"></foobar></div>' ) ;
15+ var template = templateWithWrap . children ( ) . eq ( 0 ) ;
16+
17+ $compile ( template ) ( $rootScope ) ;
18+ $rootScope . $apply ( ) ;
19+ templateWithWrap . children ( ) . length . should . equal ( 1 ) ;
20+ templateWithWrap . children ( ) . is ( 'foobar' ) . should . be . true ;
21+ templateWithWrap . children ( ) . eq ( 0 ) . children ( ) . length . should . equal ( 1 ) ;
22+ templateWithWrap . children ( ) . eq ( 0 ) . children ( ) . is ( 'div' ) . should . be . true ;
23+ templateWithWrap . children ( ) . eq ( 0 ) . children ( ) . hasClass ( 'yes' ) . should . be . true ;
24+
25+ } ) ;
26+ } ) ;
27+ } ) ;
Original file line number Diff line number Diff line change @@ -1615,37 +1615,4 @@ describe('Schema form',function(){
16151615 } ) ;
16161616
16171617 } ) ;
1618-
1619-
1620-
1621-
1622- describe ( 'decorator factory service' , function ( ) {
1623- beforeEach ( module ( 'templates' ) ) ;
1624- beforeEach ( module ( 'schemaForm' ) ) ;
1625-
1626- it ( 'should enable you to create new decorator directives' , function ( ) {
1627- module ( function ( schemaFormDecoratorsProvider ) {
1628- schemaFormDecoratorsProvider . createDecorator ( 'foobar' , { 'foo' :'/bar.html' } , [ angular . noop ] ) ;
1629- } ) ;
1630-
1631- inject ( function ( $rootScope , $compile , $templateCache ) {
1632- $templateCache . put ( '/bar.html' , '<div class="yes">YES</div>' ) ;
1633-
1634- //Since our directive does a replace we need a wrapper to actually check the content.
1635- var templateWithWrap = angular . element ( '<div id="wrap"><foobar form="{ type: \'foo\'}"></foobar></div>' ) ;
1636- var template = templateWithWrap . children ( ) . eq ( 0 ) ;
1637-
1638- $compile ( template ) ( $rootScope ) ;
1639- $rootScope . $apply ( ) ;
1640- templateWithWrap . children ( ) . length . should . equal ( 1 ) ;
1641- templateWithWrap . children ( ) . is ( 'foobar' ) . should . be . true ;
1642- templateWithWrap . children ( ) . eq ( 0 ) . children ( ) . length . should . equal ( 1 ) ;
1643- templateWithWrap . children ( ) . eq ( 0 ) . children ( ) . is ( 'div' ) . should . be . true ;
1644- templateWithWrap . children ( ) . eq ( 0 ) . children ( ) . hasClass ( 'yes' ) . should . be . true ;
1645-
1646- } ) ;
1647- } ) ;
1648- } ) ;
1649-
1650-
16511618} ) ;
You can’t perform that action at this time.
0 commit comments