pi-agent: Implement progressive Target detection
This commit is contained in:
@@ -49,6 +49,9 @@ func TestApplicationTargetSeamRequiresActiveProfileAndReturnsTruthfulResults(t *
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if result := application.Dispatch(app.Intent{Kind: app.RefreshTargets}); result.Err != nil {
|
||||
t.Fatal(result.Err)
|
||||
}
|
||||
initial := application.Snapshot()
|
||||
if len(initial.Targets) != 1 || initial.Targets[0].State != target.External || initial.Targets[0].Description.Summary != "Shell summary" {
|
||||
t.Fatalf("initial Target snapshot = %#v", initial.Targets)
|
||||
@@ -104,6 +107,9 @@ func TestApplicationHidesUnavailableTargetButKeepsExplanation(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if result := application.Dispatch(app.Intent{Kind: app.RefreshTargets}); result.Err != nil {
|
||||
t.Fatal(result.Err)
|
||||
}
|
||||
got := application.Snapshot().Targets[0]
|
||||
if got.Available || got.AvailabilityEvidence != "fake detection" {
|
||||
t.Fatalf("unavailable Target = %#v", got)
|
||||
|
||||
Reference in New Issue
Block a user