Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early finish fix #1544

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion service/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Aug 19 11:54:07 UTC 2024 - Josef Reidinger <jreidinger@suse.com>

- Fix early finish of installation (gh#openSUSE/agama#1544)

-------------------------------------------------------------------
Tue Aug 13 14:57:21 UTC 2024 - David Diaz <dgonzalez@suse.com>

Expand Down
48 changes: 48 additions & 0 deletions web/src/api/status.test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
});
4 changes: 2 additions & 2 deletions web/src/api/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import { InstallerStatus } from "~/types/status";
* Returns the installer status information
*/
const fetchInstallerStatus = async (): Promise<InstallerStatus> => {
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 };
Loading