Skip to content

Commit

Permalink
Merge branch 'main' into search-app-pageTemplate-cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
saarikabhasi authored Apr 27, 2023
2 parents 0b3c896 + 3480acd commit 1e5ee6e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('getFileType', () => {
icon: 'document',
displayName: 'File Attachment Type',
getAttachmentViewObject: expect.any(Function),
getAttachmentRemovalObject: expect.any(Function),
});
});

Expand Down Expand Up @@ -184,4 +185,11 @@ describe('getFileType', () => {
);
});
});

describe('getFileAttachmentRemovalObject', () => {
it('event renders the right message', async () => {
// @ts-ignore
expect(fileType.getAttachmentRemovalObject().event).toBe('removed file');
});
});
});
1 change: 1 addition & 0 deletions x-pack/plugins/cases/public/components/files/file_type.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ export const getFileType = (): ExternalReferenceAttachmentType => ({
icon: 'document',
displayName: 'File Attachment Type',
getAttachmentViewObject: getFileAttachmentViewObject,
getAttachmentRemovalObject: () => ({ event: i18n.REMOVED_FILE }),
});
4 changes: 4 additions & 0 deletions x-pack/plugins/cases/public/components/files/translations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ export const DELETE = i18n.translate('xpack.cases.caseView.files.delete', {
export const DELETE_FILE_TITLE = i18n.translate('xpack.cases.caseView.files.deleteThisFile', {
defaultMessage: 'Delete this file?',
});

export const REMOVED_FILE = i18n.translate('xpack.cases.caseView.files.removedFile', {
defaultMessage: 'removed file',
});

0 comments on commit 1e5ee6e

Please sign in to comment.