File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 3939 "babel-preset-es2015" : " ^6.6.0" ,
4040 "babel-preset-react" : " ^6.5.0" ,
4141 "babel-preset-stage-0" : " ^6.5.0" ,
42+ "chai" : " ^3.5.0" ,
4243 "mocha" : " ^2.5.3"
4344 }
4445}
Original file line number Diff line number Diff line change 11import { BootstrapFactory } from '../src/index' ;
2+ import { expect } from 'chai' ;
23
34
45describe ( "Factory creation" , function ( ) {
56 it ( "User requests an edit factory" , function ( done ) {
7+
8+ let correctConfig = {
9+ 'string' : 'TextBox' ,
10+ 'array' : 'ArrayContainer' ,
11+ 'datetime' : 'DateTimePicker' ,
12+ 'time' : 'DateTimePicker' ,
13+ 'date' : 'DateTimePicker' ,
14+ 'int' : 'TextBox' ,
15+ 'float' : 'TextBox' ,
16+ 'bool' : 'Checkbox' ,
17+ 'group' : 'FieldGroup'
18+ } ;
19+
20+ let factory = BootstrapFactory . createComponentFactory ( "edit" ) ;
21+
22+ expect ( factory . defaultFieldComponents ) . to . be . deep . equal ( correctConfig ) ;
623 done ( )
724 } )
825
926 it ( "User requests an details factory" , function ( done ) {
27+ let correctConfig = {
28+ 'string' : 'Static' ,
29+ 'array' : 'ArrayContainer' ,
30+ 'datetime' : 'Static' ,
31+ 'time' : 'Static' ,
32+ 'date' : 'Static' ,
33+ 'int' : 'Static' ,
34+ 'float' : 'Static' ,
35+ 'bool' : 'Static' ,
36+ 'group' : 'FieldGroup'
37+ } ;
38+
39+ let factory = BootstrapFactory . createComponentFactory ( "details" ) ;
40+
41+ expect ( factory . defaultFieldComponents ) . to . be . deep . equal ( correctConfig ) ;
1042 done ( )
1143 } )
1244} ) ;
You can’t perform that action at this time.
0 commit comments