fix build (#778)

This commit is contained in:
Po Chen
2022-07-02 10:21:45 +10:00
committed by Jamil
parent 9eefca1de5
commit abd5085ab8
4 changed files with 3 additions and 7 deletions

View File

@@ -32,8 +32,6 @@ defmodule FzHttpWeb.DeviceLive.Admin.Show do
case Devices.delete_device(device) do
{:ok, _deleted_device} ->
{:ok, _deleted_pubkey} = @events_module.delete_device(device)
{:noreply,
socket
|> dispatch_delete_device(device)

View File

@@ -25,8 +25,6 @@ defmodule FzHttpWeb.DeviceLive.Unprivileged.Show do
case delete_device(device, socket) do
{:ok, _deleted_device} ->
{:ok, _deleted_pubkey} = @events_module.delete_device(device)
{:noreply,
socket
|> dispatch_delete_device(device)

View File

@@ -7,8 +7,8 @@ defmodule FzHttpWeb.MockEvents do
inside FzHttp and use that for the tests.
"""
def delete_device(device) do
{:ok, device}
def delete_device(_device) do
maybe_mock_error()
end
def create_user(_user) do

View File

@@ -45,7 +45,7 @@ defmodule FzHttp.EventsTest do
test "removes device from vpn and wall state", %{device: device} do
:ok = Events.update_device(device)
pubkey = device.public_key
assert {:ok, ^pubkey} = Events.delete_device(device)
assert :ok = Events.delete_device(device)
assert :sys.get_state(Events.vpn_pid()) == %{}