diff --git a/service/.gitignore b/service/.gitignore index 3d17f348a7..9372acfab2 100644 --- a/service/.gitignore +++ b/service/.gitignore @@ -49,7 +49,7 @@ build-iPhoneSimulator/ # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: # Gemfile.lock -# .ruby-version +.ruby-version # .ruby-gemset # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: diff --git a/web/package/agama-web-ui.changes b/web/package/agama-web-ui.changes index 3f0b2a424d..1b61dbe557 100644 --- a/web/package/agama-web-ui.changes +++ b/web/package/agama-web-ui.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 19 11:54:07 UTC 2024 - Josef Reidinger + +- Fix early finish of installation (gh#openSUSE/agama#1544) + ------------------------------------------------------------------- Tue Aug 13 14:57:21 UTC 2024 - David Diaz diff --git a/web/src/api/status.test.ts b/web/src/api/status.test.ts new file mode 100644 index 0000000000..e27a084a6f --- /dev/null +++ b/web/src/api/status.test.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) [2024] SUSE LLC + * + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, contact SUSE LLC. + * + * To contact SUSE LLC about this file by physical or electronic mail, you may + * find current contact information at www.suse.com. + */ + +// @ts-check + +import { get } from "./http"; +import { fetchInstallerStatus } from "./status"; + +const mockGetFn = jest.fn().mockImplementation(() => { + return { + phase: 2, + busy: [], + iguana: false, + canInstall: false + }; +}); + +jest.mock("./http", () => { + return { + // TODO: fix mocking of get. How to do it for api tests? + // get: mockGetFn, + }; +}); + +describe("#fetchInstallerStatus", () => { + it.skip("parses response from manager/installer", async() => { + const response = await fetchInstallerStatus(); + expect(response.isBusy).toEqual(false); + }); +}); \ No newline at end of file diff --git a/web/src/api/status.ts b/web/src/api/status.ts index ecef91dad9..3d4ae4bbc4 100644 --- a/web/src/api/status.ts +++ b/web/src/api/status.ts @@ -26,8 +26,8 @@ import { InstallerStatus } from "~/types/status"; * Returns the installer status information */ const fetchInstallerStatus = async (): Promise => { - const { phase, isBusy, useIguana, canInstall } = await get("/api/manager/installer"); - return { phase, isBusy, useIguana, canInstall }; + const { phase, busy, iguana, canInstall } = await get("/api/manager/installer"); + return { phase, isBusy: busy.length !== 0, useIguana: iguana, canInstall }; }; export { fetchInstallerStatus };