浏览代码

Tests: Added more goodies.

Piotrek Koszuliński 9 年之前
父节点
当前提交
071c7bcb22
共有 2 个文件被更改,包括 11 次插入2 次删除
  1. 10 2
      tests/creator/manual/creator-multi.js
  2. 1 0
      tests/creator/manual/creator-multi.md

+ 10 - 2
tests/creator/manual/creator-multi.js

@@ -25,9 +25,17 @@ function initEditor() {
 		window.editor = editor = newEditor;
 		window.editor = editor = newEditor;
 		window.editables = editables = editor.editables;
 		window.editables = editables = editor.editables;
 
 
+		const editable1 = editables.get( 'editable1' );
+		const editable2 = editables.get( 'editable2' );
+
+		editable1.toString = editable2.toString = function() {
+			return `Editable(${ this.name })`;
+		};
+
 		observer = testUtils.createObserver();
 		observer = testUtils.createObserver();
-		observer.observe( 'Editable 1', editables.get( 'editable1' ) );
-		observer.observe( 'Editable 2', editables.get( 'editable2' ) );
+		observer.observe( 'Editable 1', editable1 );
+		observer.observe( 'Editable 2', editable2 );
+		observer.observe( 'EditableCollection', editables );
 
 
 		document.getElementById( 'editorContainer' ).appendChild( editor.ui.view.element );
 		document.getElementById( 'editorContainer' ).appendChild( editor.ui.view.element );
 	} );
 	} );

+ 1 - 0
tests/creator/manual/creator-multi.md

@@ -18,4 +18,5 @@
   * `editables.get( 'editable1/2' ).isEditable`,
   * `editables.get( 'editable1/2' ).isEditable`,
   * `boldModel.isEnabled` and `italicModel.isEnabled`.
   * `boldModel.isEnabled` and `italicModel.isEnabled`.
 * Changes to `editable.isFocused/isEditable` should be logged to the console.
 * Changes to `editable.isFocused/isEditable` should be logged to the console.
+* Changes to `editables.current` should be logged to the console.
 * Clicks on the buttons should be logged to the console.
 * Clicks on the buttons should be logged to the console.