@@ -26,7 +26,7 @@ describe("fieldImage.vue", function() {
26
26
readonly : false
27
27
} ;
28
28
let model = { avatar : "https://s3.amazonaws.com/uifaces/faces/twitter/calebogden/128.jpg" } ;
29
- let input ;
29
+ let input , fileInput ;
30
30
31
31
before ( ( ) => {
32
32
createField ( this , schema , model , false ) ;
@@ -46,7 +46,7 @@ describe("fieldImage.vue", function() {
46
46
} ) ;
47
47
48
48
it ( "should contain a file input element" , ( ) => {
49
- let fileInput = el . querySelector ( "input[type=file]" ) ;
49
+ fileInput = el . querySelector ( "input[type=file]" ) ;
50
50
expect ( fileInput ) . to . be . defined ;
51
51
expect ( fileInput . classList . contains ( "form-control" ) ) . to . be . true ;
52
52
expect ( fileInput . classList . contains ( "file" ) ) . to . be . true ;
@@ -67,7 +67,7 @@ describe("fieldImage.vue", function() {
67
67
} ) ;
68
68
} ) ;
69
69
70
- describe ( "check optional attribute" , ( ) => {
70
+ describe ( "check optional attribute on text input " , ( ) => {
71
71
let attributes = [ "autocomplete" , "disabled" , "placeholder" , "readonly" ] ;
72
72
73
73
attributes . forEach ( function ( name ) {
@@ -77,6 +77,17 @@ describe("fieldImage.vue", function() {
77
77
} ) ;
78
78
} ) ;
79
79
80
+ // TODO: not working inputName test.
81
+ describe . skip ( "check optional attribute on file input" , ( ) => {
82
+ let attributes = [ "disabled" , "inputName" ] ;
83
+
84
+ attributes . forEach ( function ( name ) {
85
+ it ( "should set " + name , function ( done ) {
86
+ checkAttribute ( name , vm , fileInput , field , schema , done ) ;
87
+ } ) ;
88
+ } ) ;
89
+ } ) ;
90
+
80
91
it ( "input value should be the model value after changed" , ( done ) => {
81
92
model . avatar = "https://s3.amazonaws.com/uifaces/faces/twitter/felipebsb/128.jpg" ;
82
93
vm . $nextTick ( ( ) => {
0 commit comments