Parcourir la source

Added missing test.

Maciej Bukowski il y a 5 ans
Parent
commit
05b0990029
1 fichiers modifiés avec 20 ajouts et 0 suppressions
  1. 20 0
      packages/ckeditor5-utils/tests/config.js

+ 20 - 0
packages/ckeditor5-utils/tests/config.js

@@ -6,6 +6,7 @@
 /* global document */
 
 import Config from '../src/config';
+import areConnectedThroughProperties from '../src/areconnectedthroughproperties';
 
 describe( 'Config', () => {
 	let config;
@@ -63,6 +64,25 @@ describe( 'Config', () => {
 			expect( config.get( 'bar' ) ).to.equal( 2 );
 		} );
 
+		it( 'should copy default configuration to not share properties between config instances [watchdog]', () => {
+			const defaultConfig = {
+				foo: 1,
+				bar: [
+					/some regex/,
+					{
+						baz: {}
+					}
+				]
+			};
+
+			const config1 = new Config( {}, defaultConfig );
+			const config2 = new Config( {}, defaultConfig );
+
+			const areStructuresConnected = areConnectedThroughProperties( config1, config2 );
+
+			expect( areStructuresConnected ).to.be.false;
+		} );
+
 		it( 'passed parameters should override default parameters', () => {
 			const defaultConfig = {
 				foo: 1,