This repository was archived by the owner on Jun 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export default class ClassicEditor extends StandardEditor {
8181 */
8282 static create ( element , config ) {
8383 return new Promise ( ( resolve ) => {
84- const editor = new ClassicEditor ( element , config ) ;
84+ const editor = new this ( element , config ) ;
8585
8686 resolve (
8787 editor . initPlugins ( )
Original file line number Diff line number Diff line change @@ -87,6 +87,22 @@ describe( 'ClassicEditor', () => {
8787 it ( 'loads data from the editor element' , ( ) => {
8888 expect ( editor . getData ( ) ) . to . equal ( '<p><strong>foo</strong> bar</p>' ) ;
8989 } ) ;
90+
91+ it ( 'creates an instance of a ClassicEditor child class' , ( ) => {
92+ class CustomClassicEditor extends ClassicEditor { }
93+
94+ return CustomClassicEditor . create ( editorElement , {
95+ plugins : [ Paragraph , Bold ]
96+ } )
97+ . then ( newEditor => {
98+ editor = newEditor ;
99+
100+ expect ( newEditor ) . to . be . instanceof ( CustomClassicEditor ) ;
101+ expect ( newEditor ) . to . be . instanceof ( ClassicEditor ) ;
102+
103+ expect ( newEditor . getData ( ) ) . to . equal ( '<p><strong>foo</strong> bar</p>' ) ;
104+ } ) ;
105+ } ) ;
90106 } ) ;
91107
92108 describe ( 'create - events' , ( ) => {
You can’t perform that action at this time.
0 commit comments