@@ -154,6 +154,55 @@ describe('WProofreader', () => {
154154 } ) ;
155155 } )
156156
157+ describe ( 'with badgeOffset options' , ( ) => {
158+ it ( 'should set `11` pixels to the badgeOffset options' , ( ) => {
159+ return ClassicEditor
160+ . create ( element , {
161+ plugins : [ WProofreader ] ,
162+ wproofreader : WPROOFREADER_CONFIG
163+ } )
164+ . then ( ( editor ) => {
165+ const wproofreader = editor . plugins . get ( 'WProofreader' ) ;
166+
167+ expect ( wproofreader . _userOptions . badgeOffsetX ) . to . be . equal ( 11 ) ;
168+ expect ( wproofreader . _userOptions . badgeOffsetY ) . to . be . equal ( 11 ) ;
169+ } )
170+ } ) ;
171+
172+ it ( 'should set user values to the badgeOffset options' , ( ) => {
173+ const badgeOffsetX = 12 ;
174+ const badgeOffsetY = 13 ;
175+
176+ return ClassicEditor
177+ . create ( element , {
178+ plugins : [ WProofreader ] ,
179+ wproofreader : Object . assign ( { } , WPROOFREADER_CONFIG , { badgeOffsetX, badgeOffsetY } )
180+ } )
181+ . then ( ( editor ) => {
182+ const wproofreader = editor . plugins . get ( 'WProofreader' ) ;
183+
184+ expect ( wproofreader . _userOptions . badgeOffsetX ) . to . be . equal ( badgeOffsetX ) ;
185+ expect ( wproofreader . _userOptions . badgeOffsetY ) . to . be . equal ( badgeOffsetY ) ;
186+ } )
187+ } ) ;
188+ } )
189+
190+ describe ( 'with fullSizeBadge option' , ( ) => {
191+ it ( 'should avoid setting default badgeOffset options' , ( ) => {
192+ return ClassicEditor
193+ . create ( element , {
194+ plugins : [ WProofreader ] ,
195+ wproofreader : Object . assign ( { } , WPROOFREADER_CONFIG , { fullSizeBadge : true } )
196+ } )
197+ . then ( ( editor ) => {
198+ const wproofreader = editor . plugins . get ( 'WProofreader' ) ;
199+
200+ expect ( wproofreader . _userOptions . badgeOffsetX ) . to . be . undefined ;
201+ expect ( wproofreader . _userOptions . badgeOffsetY ) . to . be . undefined ;
202+ } )
203+ } ) ;
204+ } )
205+
157206 describe ( 'disable functionality' , ( ) => {
158207 it ( 'should enable the plugin and instances because autoStartup option is enabled' , ( ) => {
159208 return ClassicEditor
0 commit comments