Skip to content

Commit

Permalink
Adjust software updates event handler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku committed Apr 18, 2024
1 parent 9cb4ddc commit f930a0d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ defmodule Trento.Infrastructure.Commanded.EventHandlers.SoftwareUpdatesDiscovery

alias Trento.Infrastructure.Commanded.EventHandlers.SoftwareUpdatesDiscoveryEventHandler

require Trento.SoftwareUpdates.Enums.SoftwareUpdatesHealth, as: SoftwareUpdatesHealth

setup [:set_mox_from_context, :verify_on_exit!]

test "should discover software updates when a SoftwareUpdatesDiscoveryRequested is emitted" do
Expand Down Expand Up @@ -63,8 +65,11 @@ defmodule Trento.Infrastructure.Commanded.EventHandlers.SoftwareUpdatesDiscovery
expect(
Trento.Commanded.Mock,
:dispatch,
0,
fn _ -> :ok end
fn %CompleteSoftwareUpdatesDiscovery{
health: SoftwareUpdatesHealth.unknown()
} ->
:ok
end
)

assert :ok = SoftwareUpdatesDiscoveryEventHandler.handle(event, %{})
Expand Down

0 comments on commit f930a0d

Please sign in to comment.