File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,18 @@ describe('Editable configuration', () => {
3939 Editable . globalConfig ( originalConfig )
4040 } )
4141
42+ it ( 'retreives the default config' , ( ) => {
43+ expect ( originalConfig ) . toEqual ( Editable . getGlobalConfig ( ) )
44+ } )
45+
46+ it ( 'retrieves the default config after changes to the globalConfig' , ( ) => {
47+ Editable . globalConfig ( {
48+ editableClass : 'editable-instance'
49+ } )
50+
51+ expect ( originalConfig ) . not . toEqual ( Editable . getGlobalConfig ( ) )
52+ } )
53+
4254 it ( 'has a default value for "editableClass"' , ( ) => {
4355 expect ( config . editableClass ) . toEqual ( 'js-editable' )
4456 } )
Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ const Editable = module.exports = class Editable {
5858 }
5959 }
6060
61+ /**
62+ * @returns the default Editable configs from config.js
63+ */
64+ static getGlobalConfig ( ) {
65+ return config
66+ }
67+
6168 /**
6269 * Set configuration options that affect all editable
6370 * instances.
You can’t perform that action at this time.
0 commit comments