Skip to content

Commit

Permalink
feat(drawing): Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingze Xiao committed Dec 15, 2020
1 parent 182c3ba commit f185321
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/lib/viewers/doc/__tests__/DocBaseViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2946,12 +2946,12 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => {

describe('handleAnnotationColorChange', () => {
beforeEach(() => {
docBase.annotator = {
emit: jest.fn(),
};
docBase.annotationModule = {
setColor: jest.fn(),
};
docBase.annotator = {
emit: jest.fn(),
};
docBase.renderUI = jest.fn();
});

Expand All @@ -2960,7 +2960,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => {
docBase.handleAnnotationColorChange(color);

expect(docBase.annotationModule.setColor).toBeCalledWith(color);
expect(docBase.annotator.emit).toBeCalledWith('annotations_stroke_set', { color: '#fff' });
expect(docBase.annotator.emit).toBeCalledWith(ANNOTATOR_EVENT.setStroke, { color });
expect(docBase.renderUI).toHaveBeenCalled();
});
});
Expand Down
14 changes: 9 additions & 5 deletions src/lib/viewers/image/__tests__/ImageViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import Browser from '../../../Browser';
import ControlsRoot from '../../controls/controls-root';
import ImageControls from '../ImageControls';
import ImageViewer from '../ImageViewer';
import { CLASS_ANNOTATIONS_IMAGE_FTUX_CURSOR_SEEN, IMAGE_FTUX_CURSOR_SEEN_KEY } from '../../../constants';
import {
ANNOTATOR_EVENT,
CLASS_ANNOTATIONS_IMAGE_FTUX_CURSOR_SEEN,
IMAGE_FTUX_CURSOR_SEEN_KEY,
} from '../../../constants';

jest.mock('../../controls/controls-root');

Expand Down Expand Up @@ -709,12 +713,12 @@ describe('lib/viewers/image/ImageViewer', () => {

describe('handleAnnotationColorChange', () => {
beforeEach(() => {
image.annotator = {
emit: jest.fn(),
};
image.annotationModule = {
setColor: jest.fn(),
};
image.annotator = {
emit: jest.fn(),
};
image.renderUI = jest.fn();
});

Expand All @@ -723,7 +727,7 @@ describe('lib/viewers/image/ImageViewer', () => {
image.handleAnnotationColorChange(color);

expect(image.annotationModule.setColor).toBeCalledWith(color);
expect(image.annotator.emit).toBeCalledWith('annotations_stroke_set', { color: '#fff' });
expect(image.annotator.emit).toBeCalledWith(ANNOTATOR_EVENT.setStroke, { color });
expect(image.renderUI).toHaveBeenCalled();
});
});
Expand Down

0 comments on commit f185321

Please sign in to comment.