bugfix: Deleted hosts were lingering in the TUI list.

This commit is contained in:
2025-11-29 02:38:12 +00:00
parent 9598444d56
commit 76e364ca3e
3 changed files with 152 additions and 9 deletions
+15
View File
@@ -219,6 +219,21 @@ func TestServer_HandleDelete(t *testing.T) {
assert.Equal(t, "ok", resp.Status)
})
t.Run("verify deleted entry not in list", func(t *testing.T) {
// After delete, list should not contain the deleted entry
resp := server.handleList()
assert.Equal(t, "ok", resp.Status)
var data protocol.ListData
err := resp.ParseData(&data)
require.NoError(t, err)
// Check that the deleted entry is not in the list
for _, entry := range data.Entries {
assert.NotEqual(t, "todelete", entry.Alias, "deleted entry should not appear in list")
}
})
t.Run("delete nonexistent", func(t *testing.T) {
req, _ := protocol.NewRequest(protocol.RequestDelete, protocol.DeletePayload{
Alias: "nonexistent",