Kaynağa Gözat

Tests: Clear graveyards in OT tests after editors data is set.

Szymon Cofalik 7 yıl önce
ebeveyn
işleme
b286acc45d

+ 5 - 0
packages/ckeditor5-engine/tests/model/operation/transform/utils.js

@@ -66,6 +66,11 @@ export class Client {
 
 		model.document.selection._setTo( ranges );
 
+		// Purify graveyard so there are no artifact nodes there remaining after setting new data.
+		// Because of those old nodes some tests may pass even though they fail in real scenarios (those tests
+		// involve bringing back elements from graveyard, like wrap or split).
+		model.document.graveyard._removeChildren( 0, model.document.graveyard.childCount );
+
 		this.syncedVersion = this.document.version;
 	}