Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Sep 19, 2023
1 parent 8d7e1d2 commit 18cb718
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rust/agama-lib/src/software/store.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Implements the store for the storage settings.

use super::{SoftwareClient, SoftwareSettings};
use crate::manager::ManagerClient;
use crate::error::ServiceError;
use crate::manager::ManagerClient;
use zbus::Connection;

/// Loads and stores the software settings from/to the D-Bus service.
Expand Down
5 changes: 0 additions & 5 deletions service/test/agama/dbus/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@
subject
end

it "configures callbacks to be called when a product is selected" do
expect(software_client).to receive(:on_product_selected)
subject
end

it "configures callbacks from Progress interface" do
expect_any_instance_of(described_class).to receive(:register_progress_callbacks)
subject
Expand Down
11 changes: 10 additions & 1 deletion web/src/components/software/ProductSelectionPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jest.mock("~/context/software", () => ({

jest.mock("~/components/layout/Layout", () => mockLayout());

const managerMock = {
startProbing: jest.fn()
};

const softwareMock = {
getProducts: () => Promise.resolve(products),
getSelectedProduct: jest.fn(() => Promise.resolve(products[0])),
Expand All @@ -60,7 +64,10 @@ const softwareMock = {

beforeEach(() => {
createClient.mockImplementation(() => {
return { software: softwareMock };
return {
manager: managerMock,
software: softwareMock
};
});
});

Expand All @@ -72,6 +79,7 @@ describe("when the user chooses a product", () => {
const button = await screen.findByRole("button", { name: "Select" });
await user.click(button);
expect(softwareMock.selectProduct).toHaveBeenCalledWith("MicroOS");
expect(managerMock.startProbing).toHaveBeenCalled();
expect(mockNavigateFn).toHaveBeenCalledWith("/");
});
});
Expand All @@ -83,6 +91,7 @@ describe("when the user chooses does not change the product", () => {
const button = await screen.findByRole("button", { name: "Select" });
await user.click(button);
expect(softwareMock.selectProduct).not.toHaveBeenCalled();
expect(managerMock.startProbing).not.toHaveBeenCalled();
expect(mockNavigateFn).toHaveBeenCalledWith("/");
});
});

0 comments on commit 18cb718

Please sign in to comment.