feat: coordinate Active Profile target panel
This commit is contained in:
@@ -7,9 +7,27 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"proxyctl/internal/profile"
|
||||
"proxyctl/internal/target"
|
||||
)
|
||||
|
||||
func TestProductionCompositionRegistersAPTContainerGNOMEAndDaemonTargets(t *testing.T) {
|
||||
home := t.TempDir()
|
||||
environment := commandEnvironment{identity: profile.UserIdentity{Username: "tester", HomeDir: home, UID: os.Getuid(), GID: os.Getgid()}, env: map[string]string{"SHELL": "/bin/bash"}}
|
||||
targets, err := productionTargets(environment)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var ids []string
|
||||
for _, adapter := range targets {
|
||||
ids = append(ids, adapter.ID())
|
||||
}
|
||||
want := []string{"apt", "docker-containers", "gnome", "docker-daemon"}
|
||||
if strings.Join(ids, ",") != strings.Join(want, ",") {
|
||||
t.Fatalf("production Target IDs = %#v, want %#v", ids, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultInvocationStartsTUIWithNoProfileState(t *testing.T) {
|
||||
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
|
||||
var output bytes.Buffer
|
||||
|
||||
Reference in New Issue
Block a user