diff --git a/src/extension/app/plugins/preview/preview.js b/src/extension/app/plugins/preview/preview.js index 6b748835..5291a8ee 100644 --- a/src/extension/app/plugins/preview/preview.js +++ b/src/extension/app/plugins/preview/preview.js @@ -71,20 +71,20 @@ export function createPreviewPlugin(appStore) { const neitherGdocOrGSheet = !isGoogleDocMime && !isGoogleSheetMime; if (neitherGdocOrGSheet) { - const isMsDocMime = contentType === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; + const isMsWordMime = contentType === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; const isMsExcelSheet = contentType === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; let errorKey = 'error_preview_not_gdoc_generic'; // show generic message by default // istanbul ignore else - if (isMsDocMime) { - errorKey = 'error_preview_not_gdoc_ms_word'; + if (isMsWordMime) { + errorKey = 'error_preview_no_docx'; } else if (isMsExcelSheet) { - errorKey = 'error_preview_not_gsheet_ms_excel'; + errorKey = 'error_preview_no_xlsx'; } appStore.showToast({ message: appStore.i18n(errorKey), - variant: 'negative', + variant: 'warning', }); return; diff --git a/test/app/plugins/preview/preview.test.js b/test/app/plugins/preview/preview.test.js index 000b890a..2514bc27 100644 --- a/test/app/plugins/preview/preview.test.js +++ b/test/app/plugins/preview/preview.test.js @@ -194,7 +194,7 @@ describe('Preview plugin', () => { edit: { status: 200, sourceLocation: 'gdrive:driveid', - contentType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + contentType: 'application/vnd.openxmlformats-officedocument.fooml.document', }, }, ); @@ -217,8 +217,8 @@ describe('Preview plugin', () => { await sidekickTest.clickToastClose(); expect(closeToastSpy.calledOnce); expect(toastSpy.calledOnceWith({ - message: 'This is a Microsoft Excel document. Please convert it to Google Sheets: File > Save as Google Sheets', - variant: 'negative', + message: 'Preview generation failed. Must be Google document or spreadsheet.', + variant: 'warning', })); }); @@ -253,8 +253,8 @@ describe('Preview plugin', () => { await waitUntil(() => toastSpy.calledOnce); expect(toastSpy.calledOnceWith({ - message: 'This is a Microsoft Excel document. Please convert it to Google Sheets: File > Save as Google Sheets', - variant: 'negative', + message: 'This is a Microsoft Word document. Please convert it to Google Docs first.', + variant: 'warning', })); }); @@ -289,8 +289,8 @@ describe('Preview plugin', () => { await waitUntil(() => toastSpy.calledOnce); expect(toastSpy.calledOnceWith({ - message: 'This is a Microsoft Excel document. Please convert it to Google Sheets: File > Save as Google Sheets', - variant: 'negative', + message: 'This is a Microsoft Excel document. Please convert it to Google Sheets first.', + variant: 'warning', })); }); });