Skip to content

Commit 5370c39

Browse files
committed
Do not mock metadata utils in tests
1 parent 20a0ff0 commit 5370c39

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/sidebar/components/Annotation/test/AnnotationEditor-test.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ describe('AnnotationEditor', () => {
1313
let fakeApplyTheme;
1414
let fakeAnnotationsService;
1515
let fakeGroup;
16-
let fakeMetadata;
1716
let fakeTagsService;
1817
let fakeSettings;
1918
let fakeToastMessenger;
@@ -45,11 +44,6 @@ describe('AnnotationEditor', () => {
4544
type: 'private',
4645
};
4746

48-
fakeMetadata = {
49-
isReply: sinon.stub().returns(false),
50-
isSaved: sinon.stub().returns(true),
51-
};
52-
5347
fakeSettings = {};
5448
fakeTagsService = {
5549
store: sinon.stub(),
@@ -69,7 +63,6 @@ describe('AnnotationEditor', () => {
6963
$imports.$mock(mockImportedComponents());
7064
$imports.$mock({
7165
'../../store/use-store': { useStoreProxy: () => fakeStore },
72-
'../../helpers/annotation-metadata': fakeMetadata,
7366
'../../helpers/theme': { applyTheme: fakeApplyTheme },
7467
});
7568
// `AnnotationLicense` is a presentation-only component and is only used
@@ -302,8 +295,7 @@ describe('AnnotationEditor', () => {
302295
});
303296

304297
it('does not update privacy default if annotation is a reply', () => {
305-
fakeMetadata.isReply.returns(true);
306-
const wrapper = createComponent();
298+
const wrapper = createComponent({ annotation: fixtures.newReply() });
307299

308300
wrapper.find('AnnotationPublishControl').props().onSetPrivate(false);
309301

@@ -325,8 +317,7 @@ describe('AnnotationEditor', () => {
325317
});
326318

327319
it('removes annotation from store if it is an unsaved annotation', () => {
328-
fakeMetadata.isSaved.returns(false);
329-
const wrapper = createComponent();
320+
const wrapper = createComponent({ annotation: fixtures.newAnnotation() });
330321

331322
wrapper.find('AnnotationPublishControl').props().onCancel();
332323

0 commit comments

Comments
 (0)