Commit 5370c39d authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Do not mock metadata utils in tests

parent 20a0ff01
...@@ -13,7 +13,6 @@ describe('AnnotationEditor', () => { ...@@ -13,7 +13,6 @@ describe('AnnotationEditor', () => {
let fakeApplyTheme; let fakeApplyTheme;
let fakeAnnotationsService; let fakeAnnotationsService;
let fakeGroup; let fakeGroup;
let fakeMetadata;
let fakeTagsService; let fakeTagsService;
let fakeSettings; let fakeSettings;
let fakeToastMessenger; let fakeToastMessenger;
...@@ -45,11 +44,6 @@ describe('AnnotationEditor', () => { ...@@ -45,11 +44,6 @@ describe('AnnotationEditor', () => {
type: 'private', type: 'private',
}; };
fakeMetadata = {
isReply: sinon.stub().returns(false),
isSaved: sinon.stub().returns(true),
};
fakeSettings = {}; fakeSettings = {};
fakeTagsService = { fakeTagsService = {
store: sinon.stub(), store: sinon.stub(),
...@@ -69,7 +63,6 @@ describe('AnnotationEditor', () => { ...@@ -69,7 +63,6 @@ describe('AnnotationEditor', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../../store/use-store': { useStoreProxy: () => fakeStore }, '../../store/use-store': { useStoreProxy: () => fakeStore },
'../../helpers/annotation-metadata': fakeMetadata,
'../../helpers/theme': { applyTheme: fakeApplyTheme }, '../../helpers/theme': { applyTheme: fakeApplyTheme },
}); });
// `AnnotationLicense` is a presentation-only component and is only used // `AnnotationLicense` is a presentation-only component and is only used
...@@ -302,8 +295,7 @@ describe('AnnotationEditor', () => { ...@@ -302,8 +295,7 @@ describe('AnnotationEditor', () => {
}); });
it('does not update privacy default if annotation is a reply', () => { it('does not update privacy default if annotation is a reply', () => {
fakeMetadata.isReply.returns(true); const wrapper = createComponent({ annotation: fixtures.newReply() });
const wrapper = createComponent();
wrapper.find('AnnotationPublishControl').props().onSetPrivate(false); wrapper.find('AnnotationPublishControl').props().onSetPrivate(false);
...@@ -325,8 +317,7 @@ describe('AnnotationEditor', () => { ...@@ -325,8 +317,7 @@ describe('AnnotationEditor', () => {
}); });
it('removes annotation from store if it is an unsaved annotation', () => { it('removes annotation from store if it is an unsaved annotation', () => {
fakeMetadata.isSaved.returns(false); const wrapper = createComponent({ annotation: fixtures.newAnnotation() });
const wrapper = createComponent();
wrapper.find('AnnotationPublishControl').props().onCancel(); wrapper.find('AnnotationPublishControl').props().onCancel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment