diff --git a/src/lib/viewers/BaseViewer.js b/src/lib/viewers/BaseViewer.js index 7855b6379..f27fa85d9 100644 --- a/src/lib/viewers/BaseViewer.js +++ b/src/lib/viewers/BaseViewer.js @@ -968,6 +968,7 @@ class BaseViewer extends EventEmitter { const annotatorOptions = this.createAnnotatorOptions({ annotator: this.annotatorConf, + features: options && options.features, intl: (options && options.intl) || intlUtil.createAnnotatorIntl(), modeButtons: ANNOTATION_BUTTONS, }); diff --git a/src/lib/viewers/__tests__/BaseViewer-test.js b/src/lib/viewers/__tests__/BaseViewer-test.js index ce4438af5..4ef68d72f 100644 --- a/src/lib/viewers/__tests__/BaseViewer-test.js +++ b/src/lib/viewers/__tests__/BaseViewer-test.js @@ -1166,18 +1166,24 @@ describe('lib/viewers/BaseViewer', () => { }); it('should call createAnnotatorOptions with locale, language, and messages from options', () => { + const createOptionsArg = { + ...annotationsOptions, + features: { + enabledFeature: true, + }, + }; sandbox.stub(base, 'areAnnotationsEnabled').returns(true); sandbox.stub(base, 'createAnnotatorOptions'); base.options.boxAnnotations = { determineAnnotator: sandbox.stub().returns(conf), - getOptions: sandbox.stub().returns(annotationsOptions), + getOptions: sandbox.stub().returns(createOptionsArg), }; base.createAnnotator(); expect(base.options.boxAnnotations.getOptions).to.be.called; - expect(base.createAnnotatorOptions).to.be.calledWith(sinon.match(annotationsOptions)); + expect(base.createAnnotatorOptions).to.be.calledWith(sinon.match(createOptionsArg)); }); it('should use default intl lib if annotator options not present ', () => {