From 871c5799fdf3491bb14573c5b1cc06a9964732f5 Mon Sep 17 00:00:00 2001 From: JackGruber <24863925+JackGruber@users.noreply.github.com> Date: Wed, 6 Mar 2024 20:27:14 +0100 Subject: [PATCH] Fix test after isThereData implementation --- __test__/backup.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/__test__/backup.test.ts b/__test__/backup.test.ts index 2f3f9f4..4101b1f 100644 --- a/__test__/backup.test.ts +++ b/__test__/backup.test.ts @@ -29,6 +29,7 @@ let spyOnLogError = null; let spyOnShowError = null; let spyOnSaveBackupInfo = null; let spyOnDataGet = null; +let spyOnIsThereData = null; const spyOnsSettingsValue = jest.spyOn(joplin.settings, "value"); const spyOnGlobalValue = jest.spyOn(joplin.settings, "globalValue"); @@ -1119,6 +1120,15 @@ describe("Backup", function () { }); describe("create backup readme", () => { + beforeEach(async () => { + spyOnIsThereData = jest + .spyOn(backup, "isThereData") + .mockImplementation(() => Promise.resolve(true)); + }); + afterEach(async () => { + spyOnIsThereData.mockRestore(); + }); + it.each([ { backupRetention: 1, createSubfolderPerProfile: false }, { backupRetention: 2, createSubfolderPerProfile: false },