diff --git a/src/behaviours/application-update/installing-update-using-tray.test.ts b/src/behaviours/application-update/installing-update-using-tray.test.ts index ad5d8cb44d..f6570bb8fa 100644 --- a/src/behaviours/application-update/installing-update-using-tray.test.ts +++ b/src/behaviours/application-update/installing-update-using-tray.test.ts @@ -154,12 +154,12 @@ describe("installing update using tray", () => { ).toBe("Downloading update some-version (0%)..."); }); - it("when download progresses, percentage increases", () => { + it("when download progresses with decimals, percentage increases as integers", () => { const progressOfUpdateDownload = applicationBuilder.dis.mainDi.inject( progressOfUpdateDownloadInjectable, ); - progressOfUpdateDownload.set({ percentage: 42 }); + progressOfUpdateDownload.set({ percentage: 42.424242 }); expect( applicationBuilder.tray.get("check-for-updates")?.label?.get(), diff --git a/src/main/application-update/check-for-updates-tray-item.injectable.ts b/src/main/application-update/check-for-updates-tray-item.injectable.ts index 14b9de155d..5ff4be731a 100644 --- a/src/main/application-update/check-for-updates-tray-item.injectable.ts +++ b/src/main/application-update/check-for-updates-tray-item.injectable.ts @@ -41,7 +41,9 @@ const checkForUpdatesTrayItemInjectable = getInjectable({ assert(discoveredVersion); - return `Downloading update ${discoveredVersion.version} (${progressOfUpdateDownload.value.get().percentage}%)...`; + const roundedPercentage = Math.round(progressOfUpdateDownload.value.get().percentage); + + return `Downloading update ${discoveredVersion.version} (${roundedPercentage}%)...`; } if (checkingForUpdatesState.value.get()) {