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

Commit

Permalink
Removed the dataProcessor argument, as it was never used in practice.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Mar 3, 2020
1 parent 8039a8d commit b21a415
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 5 additions & 8 deletions src/controller/datacontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ export default class DataController {
/**
* Creates a data controller instance.
*
* @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor Styles processor.
* @param {module:engine/model/model~Model} model Data model.
* @param {module:engine/dataprocessor/dataprocessor~DataProcessor} [dataProcessor] Data processor that should be used
* by the controller.
* @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor Styles processor.
*/
constructor( stylesProcessor, model, dataProcessor ) {
constructor( model, stylesProcessor ) {
/**
* Data model.
*
Expand All @@ -61,7 +59,7 @@ export default class DataController {
this.model = model;

/**
* StylesProcessor is responsible for writing and reading a normalized styles object.
* Styles processor used during the conversion.
*
* @readonly
* @member {module:engine/view/stylesmap~StylesProcessor}
Expand All @@ -71,10 +69,9 @@ export default class DataController {
/**
* Data processor used during the conversion.
*
* @readonly
* @member {module:engine/dataprocessor/dataprocessor~DataProcessor}
* @member {module:engine/dataprocessor/dataprocessor~DataProcessor} #processor
*/
this.processor = dataProcessor;
this.processor;

/**
* Mapper used for the conversion. It has no permanent bindings, because they are created when getting data and
Expand Down
13 changes: 8 additions & 5 deletions tests/controller/datacontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,20 @@ describe( 'DataController', () => {
viewDocument = new ViewDocument( stylesProcessor );
htmlDataProcessor = new HtmlDataProcessor( viewDocument );

data = new DataController( stylesProcessor, model, htmlDataProcessor );
data = new DataController( model, stylesProcessor );
data.processor = htmlDataProcessor;

upcastHelpers = new UpcastHelpers( [ data.upcastDispatcher ] );
downcastHelpers = new DowncastHelpers( [ data.downcastDispatcher ] );
} );

describe( 'constructor()', () => {
it( 'works without data processor', () => {
const data = new DataController( new StylesProcessor(), model );
it( 'sets the model and styles processor properties', () => {
const stylesProcessor = new StylesProcessor();
const data = new DataController( model, stylesProcessor );

expect( data.processor ).to.be.undefined;
expect( data.model ).to.equal( model );
expect( data.stylesProcessor ).to.equal( stylesProcessor );
} );
} );

Expand Down Expand Up @@ -577,7 +580,7 @@ describe( 'DataController', () => {
describe( 'addStyleProcessorRules()', () => {
it( 'should execute callback with an instance of StyleProcessor as the first argument', () => {
const stylesProcessor = new StylesProcessor();
const data = new DataController( stylesProcessor, model, htmlDataProcessor );
const data = new DataController( model, stylesProcessor );

const spy = sinon.spy();

Expand Down

0 comments on commit b21a415

Please sign in to comment.