Преглед на файлове

Tests for doc.makeTransaction.

Piotr Jasiun преди 10 години
родител
ревизия
f6483d79f5
променени са 1 файла, в които са добавени 12 реда и са изтрити 1 реда
  1. 12 1
      packages/ckeditor5-utils/tests/document/document.js

+ 12 - 1
packages/ckeditor5-utils/tests/document/document.js

@@ -10,15 +10,17 @@
 const modules = bender.amd.require(
 	'document/document',
 	'document/rootelement',
+	'document/transaction',
 	'ckeditorerror'
 );
 
 describe( 'Document', () => {
-	let Document, RootElement, CKEditorError;
+	let Document, RootElement, Transaction, CKEditorError;
 
 	before( () => {
 		Document = modules[ 'document/document' ];
 		RootElement = modules[ 'document/rootelement' ];
+		Transaction = modules[ 'document/transaction' ];
 		CKEditorError = modules.ckeditorerror;
 	} );
 
@@ -106,4 +108,13 @@ describe( 'Document', () => {
 			).to.throw( CKEditorError, /document-applyOperation-wrong-version/ );
 		} );
 	} );
+
+	describe( 'makeTransaction', () => {
+		it( 'should create a new transaction with the document property', () => {
+			const transaction = document.makeTransaction();
+
+			expect( transaction ).to.be.instanceof( Transaction );
+			expect( transaction ).to.have.property( 'doc' ).that.equals( document );
+		} );
+	} );
 } );