@@ -78,43 +78,42 @@ describe( 'ImageTextAlternativeUI', () => {
78
78
} ) ;
79
79
80
80
it ( 'should set alt attribute value to textarea and select it' , ( ) => {
81
- const spy = sinon . spy ( form . labeledInput , 'select' ) ;
81
+ const spy = sinon . spy ( form . labeledInput . fieldView , 'select' ) ;
82
82
83
83
setData ( model , '[<image src="" alt="foo bar"></image>]' ) ;
84
84
85
85
button . fire ( 'execute' ) ;
86
86
sinon . assert . calledOnce ( spy ) ;
87
- expect ( form . labeledInput . value ) . equals ( 'foo bar' ) ;
87
+ expect ( form . labeledInput . fieldView . value ) . equals ( 'foo bar' ) ;
88
88
} ) ;
89
89
90
90
it ( 'should set empty text to textarea and select it when there is no alt attribute' , ( ) => {
91
- const spy = sinon . spy ( form . labeledInput , 'select' ) ;
91
+ const spy = sinon . spy ( form . labeledInput . fieldView , 'select' ) ;
92
92
93
93
setData ( model , '[<image src=""></image>]' ) ;
94
94
95
95
button . fire ( 'execute' ) ;
96
96
sinon . assert . calledOnce ( spy ) ;
97
- expect ( form . labeledInput . value ) . equals ( '' ) ;
97
+ expect ( form . labeledInput . fieldView . value ) . equals ( '' ) ;
98
98
} ) ;
99
99
} ) ;
100
100
101
101
describe ( 'balloon panel form' , ( ) => {
102
102
// https://github.com/ckeditor/ckeditor5-image/issues/114
103
103
it ( 'should make sure the input always stays in sync with the value of the command' , ( ) => {
104
104
const button = editor . ui . componentFactory . create ( 'imageTextAlternative' ) ;
105
-
106
105
// Mock the value of the input after some past editing.
107
- form . labeledInput . value = 'foo' ;
106
+ form . labeledInput . fieldView . value = 'foo' ;
108
107
109
108
// Mock the user using the form, changing the value but clicking "Cancel".
110
109
// so the command's value is not updated.
111
- form . labeledInput . inputView . element . value = 'This value was canceled.' ;
110
+ form . labeledInput . fieldView . element . value = 'This value was canceled.' ;
112
111
113
112
// Mock the user editing the same image once again.
114
113
setData ( model , '[<image src="" alt="foo"></image>]' ) ;
115
114
116
115
button . fire ( 'execute' ) ;
117
- expect ( form . labeledInput . inputView . element . value ) . to . equal ( 'foo' ) ;
116
+ expect ( form . labeledInput . fieldView . element . value ) . to . equal ( 'foo' ) ;
118
117
} ) ;
119
118
120
119
it ( 'should execute command on submit' , ( ) => {
@@ -123,7 +122,7 @@ describe( 'ImageTextAlternativeUI', () => {
123
122
124
123
sinon . assert . calledOnce ( spy ) ;
125
124
sinon . assert . calledWithExactly ( spy , 'imageTextAlternative' , {
126
- newValue : form . labeledInput . inputView . element . value
125
+ newValue : form . labeledInput . fieldView . element . value
127
126
} ) ;
128
127
} ) ;
129
128
0 commit comments