Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Added integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Feb 13, 2020
1 parent 2133cae commit 9607309
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/utils/areconnectedthroughproperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* globals window, document, Event */

import areConnectedThroughProperties from '../../src/utils/areconnectedthroughproperties';
import Editor from '@ckeditor/ckeditor5-core/src/editor/editor';

describe( 'areConnectedThroughProperties()', () => {
it( 'should return `false` if one of the value is primitive #1', () => {
Expand Down Expand Up @@ -247,4 +248,54 @@ describe( 'areConnectedThroughProperties()', () => {

expect( areConnectedThroughProperties( el1, el2 ) ).to.be.true;
} );

describe( 'integration tests', () => {
it( 'should return false for two different editors', () => {
const editor1 = new Editor( {} );
const editor2 = new Editor( {} );

expect( areConnectedThroughProperties( editor1, editor2 ) ).to.be.false;
} );

it( 'should return false for two different editors sharing builtin plugins', () => {
class FakePlugin {}

Editor.builtinPlugins = [ FakePlugin ];

const editor1 = new Editor();
const editor2 = new Editor();

expect( areConnectedThroughProperties( editor1, editor2 ) ).to.be.false;

delete Editor.builtinPlugins;
} );

it( 'should return false for two different editors inheriting default configuration', () => {
Editor.defaultConfig = {
foo: {
bar: []
}
};

const editor1 = new Editor();
const editor2 = new Editor();

expect( areConnectedThroughProperties( editor1, editor2 ) ).to.be.false;

delete Editor.defaultConfig;
} );

it( 'should return false for two different editors sharing builtin plugins', () => {
Editor.builtinPlugins = [
class Foo {}
];

const editor1 = new Editor();
const editor2 = new Editor();

expect( areConnectedThroughProperties( editor1, editor2 ) ).to.be.false;

delete Editor.builtinPlugins;
} );
} );
} );

0 comments on commit 9607309

Please sign in to comment.