@@ -73,7 +73,7 @@ describe('Editor', () => {
73
73
} ) ;
74
74
} ) ;
75
75
76
- describe ( 'with a plugin ' , ( ) => {
76
+ describe ( 'with plugins ' , ( ) => {
77
77
let onChange ;
78
78
let editorState ;
79
79
@@ -239,6 +239,42 @@ describe('Editor', () => {
239
239
expect ( plugin . keyBindingFn ) . has . been . calledOnce ( ) ;
240
240
expect ( plugin . keyBindingFn ) . has . been . calledWith ( 'command' , pluginEditor . getEditorState , pluginEditor . onChange ) ;
241
241
} ) ;
242
+
243
+ it ( 'combines the customStyleMaps from all plugins' , ( ) => {
244
+ const plugins = [
245
+ {
246
+ customStyleMap : {
247
+ orange : {
248
+ color : 'rgba(255, 127, 0, 1.0)' ,
249
+ } ,
250
+ } ,
251
+ } ,
252
+ {
253
+ customStyleMap : {
254
+ yellow : {
255
+ color : 'rgba(180, 180, 0, 1.0)' ,
256
+ } ,
257
+ } ,
258
+ } ,
259
+ ] ;
260
+ const result = mount (
261
+ < PluginEditor
262
+ editorState = { editorState }
263
+ onChange = { onChange }
264
+ plugins = { plugins }
265
+ />
266
+ ) ;
267
+ const expected = {
268
+ orange : {
269
+ color : 'rgba(255, 127, 0, 1.0)' ,
270
+ } ,
271
+ yellow : {
272
+ color : 'rgba(180, 180, 0, 1.0)' ,
273
+ } ,
274
+ } ;
275
+ const pluginEditor = result . instance ( ) ;
276
+ expect ( pluginEditor . resolveCustomStyleMap ( ) ) . to . deep . equal ( expected ) ;
277
+ } ) ;
242
278
} ) ;
243
279
244
280
describe ( 'passed proxy to DraftEditor' , ( ) => {
0 commit comments