@@ -46,9 +46,9 @@ describe( 'HighlightCommand', () => {
46
46
47
47
describe ( 'value' , ( ) => {
48
48
it ( 'is set to highlight attribute value when selection is in text with highlight attribute' , ( ) => {
49
- setData ( model , '<p><$text highlight="marker ">fo[o]</$text></p>' ) ;
49
+ setData ( model , '<p><$text highlight="yellowMarker ">fo[o]</$text></p>' ) ;
50
50
51
- expect ( command ) . to . have . property ( 'value' , 'marker ' ) ;
51
+ expect ( command ) . to . have . property ( 'value' , 'yellowMarker ' ) ;
52
52
} ) ;
53
53
54
54
it ( 'is undefined when selection is not in text with highlight attribute' , ( ) => {
@@ -79,9 +79,9 @@ describe( 'HighlightCommand', () => {
79
79
describe ( 'with option.value set' , ( ) => {
80
80
describe ( 'on collapsed range' , ( ) => {
81
81
it ( 'should change entire highlight when inside highlighted text' , ( ) => {
82
- setData ( model , '<p>abc<$text highlight="marker ">foo[]bar</$text>xyz</p>' ) ;
82
+ setData ( model , '<p>abc<$text highlight="yellowMarker ">foo[]bar</$text>xyz</p>' ) ;
83
83
84
- expect ( command . value ) . to . equal ( 'marker ' ) ;
84
+ expect ( command . value ) . to . equal ( 'yellowMarker ' ) ;
85
85
86
86
command . execute ( { value : 'greenMarker' } ) ;
87
87
@@ -91,19 +91,19 @@ describe( 'HighlightCommand', () => {
91
91
} ) ;
92
92
93
93
it ( 'should remove entire highlight when inside highlighted text of the same value' , ( ) => {
94
- setData ( model , '<p>abc<$text highlight="marker ">foo[]bar</$text>xyz</p>' ) ;
94
+ setData ( model , '<p>abc<$text highlight="yellowMarker ">foo[]bar</$text>xyz</p>' ) ;
95
95
96
- expect ( command . value ) . to . equal ( 'marker ' ) ;
96
+ expect ( command . value ) . to . equal ( 'yellowMarker ' ) ;
97
97
98
- command . execute ( { value : 'marker ' } ) ;
98
+ command . execute ( { value : 'yellowMarker ' } ) ;
99
99
100
100
expect ( getData ( model ) ) . to . equal ( '<p>abcfoo[]barxyz</p>' ) ;
101
101
102
102
expect ( command . value ) . to . be . undefined ;
103
103
} ) ;
104
104
105
105
it ( 'should change selection attribute in non-empty parent' , ( ) => {
106
- setData ( model , '<p>a[]bc<$text highlight="marker ">foobar</$text>xyz</p>' ) ;
106
+ setData ( model , '<p>a[]bc<$text highlight="yellowMarker ">foobar</$text>xyz</p>' ) ;
107
107
expect ( command . value ) . to . be . undefined ;
108
108
109
109
command . execute ( { value : 'foo' } ) ;
@@ -124,7 +124,7 @@ describe( 'HighlightCommand', () => {
124
124
} ) ;
125
125
126
126
it ( 'should not store attribute change on selection if selection is collapsed in non-empty parent' , ( ) => {
127
- setData ( model , '<p>a[]bc<$text highlight="marker ">foobar</$text>xyz</p>' ) ;
127
+ setData ( model , '<p>a[]bc<$text highlight="yellowMarker ">foobar</$text>xyz</p>' ) ;
128
128
129
129
command . execute ( { value : 'foo' } ) ;
130
130
@@ -142,7 +142,7 @@ describe( 'HighlightCommand', () => {
142
142
} ) ;
143
143
144
144
it ( 'should change selection attribute and store it if selection is collapsed in empty parent' , ( ) => {
145
- setData ( model , '<p>abc<$text highlight="marker ">foobar</$text>xyz</p><p>[]</p>' ) ;
145
+ setData ( model , '<p>abc<$text highlight="yellowMarker ">foobar</$text>xyz</p><p>[]</p>' ) ;
146
146
147
147
expect ( command . value ) . to . be . undefined ;
148
148
@@ -176,15 +176,15 @@ describe( 'HighlightCommand', () => {
176
176
177
177
describe ( 'on not collapsed range' , ( ) => {
178
178
it ( 'should set highlight attribute on selected node when passed as parameter' , ( ) => {
179
- setData ( model , '<p>a[bc<$text highlight="marker ">fo]obar</$text>xyz</p>' ) ;
179
+ setData ( model , '<p>a[bc<$text highlight="yellowMarker ">fo]obar</$text>xyz</p>' ) ;
180
180
181
181
expect ( command . value ) . to . be . undefined ;
182
182
183
- command . execute ( { value : 'marker ' } ) ;
183
+ command . execute ( { value : 'yellowMarker ' } ) ;
184
184
185
- expect ( command . value ) . to . equal ( 'marker ' ) ;
185
+ expect ( command . value ) . to . equal ( 'yellowMarker ' ) ;
186
186
187
- expect ( getData ( model ) ) . to . equal ( '<p>a[<$text highlight="marker ">bcfo]obar</$text>xyz</p>' ) ;
187
+ expect ( getData ( model ) ) . to . equal ( '<p>a[<$text highlight="yellowMarker ">bcfo]obar</$text>xyz</p>' ) ;
188
188
} ) ;
189
189
190
190
it ( 'should set highlight attribute on selected node when passed as parameter (multiple nodes)' , ( ) => {
@@ -195,26 +195,26 @@ describe( 'HighlightCommand', () => {
195
195
'<p>barbar]bar</p>'
196
196
) ;
197
197
198
- command . execute ( { value : 'marker ' } ) ;
198
+ command . execute ( { value : 'yellowMarker ' } ) ;
199
199
200
- expect ( command . value ) . to . equal ( 'marker ' ) ;
200
+ expect ( command . value ) . to . equal ( 'yellowMarker ' ) ;
201
201
202
202
expect ( getData ( model ) ) . to . equal (
203
- '<p>abcabc[<$text highlight="marker ">abc</$text></p>' +
204
- '<p><$text highlight="marker ">foofoofoo</$text></p>' +
205
- '<p><$text highlight="marker ">barbar</$text>]bar</p>'
203
+ '<p>abcabc[<$text highlight="yellowMarker ">abc</$text></p>' +
204
+ '<p><$text highlight="yellowMarker ">foofoofoo</$text></p>' +
205
+ '<p><$text highlight="yellowMarker ">barbar</$text>]bar</p>'
206
206
) ;
207
207
} ) ;
208
208
209
209
it ( 'should set highlight attribute on selected nodes when passed as parameter only on selected characters' , ( ) => {
210
- setData ( model , '<p>abc[<$text highlight="marker ">foo]bar</$text>xyz</p>' ) ;
210
+ setData ( model , '<p>abc[<$text highlight="yellowMarker ">foo]bar</$text>xyz</p>' ) ;
211
211
212
- expect ( command . value ) . to . equal ( 'marker ' ) ;
212
+ expect ( command . value ) . to . equal ( 'yellowMarker ' ) ;
213
213
214
214
command . execute ( { value : 'foo' } ) ;
215
215
216
216
expect ( getData ( model ) ) . to . equal (
217
- '<p>abc[<$text highlight="foo">foo</$text>]<$text highlight="marker ">bar</$text>xyz</p>'
217
+ '<p>abc[<$text highlight="foo">foo</$text>]<$text highlight="yellowMarker ">bar</$text>xyz</p>'
218
218
) ;
219
219
220
220
expect ( command . value ) . to . equal ( 'foo' ) ;
@@ -225,9 +225,9 @@ describe( 'HighlightCommand', () => {
225
225
describe ( 'with undefined option.value' , ( ) => {
226
226
describe ( 'on collapsed range' , ( ) => {
227
227
it ( 'should remove entire highlight when inside highlighted text' , ( ) => {
228
- setData ( model , '<p>abc<$text highlight="marker ">foo[]bar</$text>xyz</p>' ) ;
228
+ setData ( model , '<p>abc<$text highlight="yellowMarker ">foo[]bar</$text>xyz</p>' ) ;
229
229
230
- expect ( command . value ) . to . equal ( 'marker ' ) ;
230
+ expect ( command . value ) . to . equal ( 'yellowMarker ' ) ;
231
231
232
232
command . execute ( ) ;
233
233
@@ -239,13 +239,13 @@ describe( 'HighlightCommand', () => {
239
239
240
240
describe ( 'on not collapsed range' , ( ) => {
241
241
it ( 'should remove highlight attribute on selected node when undefined passed as parameter' , ( ) => {
242
- setData ( model , '<p>abc[<$text highlight="marker ">foo]bar</$text>xyz</p>' ) ;
242
+ setData ( model , '<p>abc[<$text highlight="yellowMarker ">foo]bar</$text>xyz</p>' ) ;
243
243
244
- expect ( command . value ) . to . equal ( 'marker ' ) ;
244
+ expect ( command . value ) . to . equal ( 'yellowMarker ' ) ;
245
245
246
246
command . execute ( ) ;
247
247
248
- expect ( getData ( model ) ) . to . equal ( '<p>abc[foo]<$text highlight="marker ">bar</$text>xyz</p>' ) ;
248
+ expect ( getData ( model ) ) . to . equal ( '<p>abc[foo]<$text highlight="yellowMarker ">bar</$text>xyz</p>' ) ;
249
249
250
250
expect ( command . value ) . to . be . undefined ;
251
251
} ) ;
0 commit comments