|
@@ -7,13 +7,13 @@
|
|
|
|
|
|
|
|
'use strict';
|
|
'use strict';
|
|
|
|
|
|
|
|
-var modules = bender.amd.require(
|
|
|
|
|
|
|
+const modules = bender.amd.require(
|
|
|
'document/transaction',
|
|
'document/transaction',
|
|
|
'document/deltas/delta',
|
|
'document/deltas/delta',
|
|
|
'ckeditorerror' );
|
|
'ckeditorerror' );
|
|
|
|
|
|
|
|
describe( 'Transaction', () => {
|
|
describe( 'Transaction', () => {
|
|
|
- var Transaction, Delta, CKEditorError;
|
|
|
|
|
|
|
+ let Transaction, Delta, CKEditorError;
|
|
|
|
|
|
|
|
before( () => {
|
|
before( () => {
|
|
|
Transaction = modules[ 'document/transaction' ];
|
|
Transaction = modules[ 'document/transaction' ];
|
|
@@ -22,14 +22,14 @@ describe( 'Transaction', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should have registered basic methods', () => {
|
|
it( 'should have registered basic methods', () => {
|
|
|
- var transaction = new Transaction();
|
|
|
|
|
|
|
+ const transaction = new Transaction();
|
|
|
|
|
|
|
|
expect( transaction.setAttr ).to.be.a( 'function' );
|
|
expect( transaction.setAttr ).to.be.a( 'function' );
|
|
|
expect( transaction.removeAttr ).to.be.a( 'function' );
|
|
expect( transaction.removeAttr ).to.be.a( 'function' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( 'Transaction.register', () => {
|
|
describe( 'Transaction.register', () => {
|
|
|
- var TestDelta;
|
|
|
|
|
|
|
+ let TestDelta;
|
|
|
|
|
|
|
|
before( () => {
|
|
before( () => {
|
|
|
TestDelta = class extends Delta {
|
|
TestDelta = class extends Delta {
|
|
@@ -48,7 +48,7 @@ describe( 'Transaction', () => {
|
|
|
t.addDelta( new TestDelta() );
|
|
t.addDelta( new TestDelta() );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- var transaction = new Transaction();
|
|
|
|
|
|
|
+ const transaction = new Transaction();
|
|
|
|
|
|
|
|
transaction.foo();
|
|
transaction.foo();
|
|
|
|
|
|
|
@@ -62,7 +62,7 @@ describe( 'Transaction', () => {
|
|
|
t.addDelta( new TestDelta() );
|
|
t.addDelta( new TestDelta() );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- var transaction = new Transaction();
|
|
|
|
|
|
|
+ const transaction = new Transaction();
|
|
|
|
|
|
|
|
transaction.foo();
|
|
transaction.foo();
|
|
|
|
|
|
|
@@ -72,12 +72,12 @@ describe( 'Transaction', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should pass arguments properly', () => {
|
|
it( 'should pass arguments properly', () => {
|
|
|
- var doc = 'doc';
|
|
|
|
|
- var arg = 'arg';
|
|
|
|
|
|
|
+ const doc = 'doc';
|
|
|
|
|
+ const arg = 'arg';
|
|
|
|
|
|
|
|
- var transaction = new Transaction( doc );
|
|
|
|
|
|
|
+ const transaction = new Transaction( doc );
|
|
|
|
|
|
|
|
- var stub = sinon.stub();
|
|
|
|
|
|
|
+ const stub = sinon.stub();
|
|
|
|
|
|
|
|
Transaction.register( 'foo', stub );
|
|
Transaction.register( 'foo', stub );
|
|
|
|
|
|