@@ -66,24 +66,34 @@ func TestNewDockerClientVersionNegotiation(t *testing.T) {
6666// TestIsProjectScoped covers the predicate that drives whether the
6767// project/services panels appear and whether the containers panel filters by
6868// project. The "outside compose dir + -p" case is the regression we fixed
69- // after PR #776 silently disabled it.
69+ // after PR #776 silently disabled it. forceProjectView restores multi-project
70+ // panels when launched outside a compose directory (issue #800).
7071func TestIsProjectScoped (t * testing.T ) {
7172 cases := []struct {
7273 name string
7374 inDockerComposeProject bool
7475 projectName string
76+ forceProjectView bool
7577 want bool
7678 }{
77- {"inside compose dir, no -p" , true , "" , true },
78- {"inside compose dir, with -p" , true , "myproject" , true },
79- {"outside compose dir, no -p" , false , "" , false },
80- {"outside compose dir, with -p" , false , "myproject" , true },
79+ {"inside compose dir, no -p" , true , "" , false , true },
80+ {"inside compose dir, with -p" , true , "myproject" , false , true },
81+ {"outside compose dir, no -p" , false , "" , false , false },
82+ {"outside compose dir, with -p" , false , "myproject" , false , true },
83+ {"outside compose dir, forceProjectView" , false , "" , true , true },
84+ {"outside compose dir, forceProjectView and -p" , false , "myproject" , true , true },
85+ {"inside compose dir, forceProjectView" , true , "" , true , true },
8186 }
8287 for _ , tc := range cases {
8388 t .Run (tc .name , func (t * testing.T ) {
8489 c := & DockerCommand {
8590 InDockerComposeProject : tc .inDockerComposeProject ,
86- Config : & config.AppConfig {ProjectName : tc .projectName },
91+ Config : & config.AppConfig {
92+ ProjectName : tc .projectName ,
93+ UserConfig : & config.UserConfig {
94+ Gui : config.GuiConfig {ForceProjectView : tc .forceProjectView },
95+ },
96+ },
8797 }
8898 assert .Equal (t , tc .want , c .IsProjectScoped ())
8999 })
0 commit comments