From f89806e55d88e9695882f1f275c16a7b10265cb1 Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Wed, 9 Sep 2026 12:52:43 +0200 Subject: [PATCH] Convert the VNC MDM test to the explicit policy helper --- client/internal/profilemanager/config_mdm_test.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/client/internal/profilemanager/config_mdm_test.go b/client/internal/profilemanager/config_mdm_test.go index b91d66843..cbcfe8b27 100644 --- a/client/internal/profilemanager/config_mdm_test.go +++ b/client/internal/profilemanager/config_mdm_test.go @@ -153,24 +153,20 @@ func TestApply_MDMVNCKeys(t *testing.T) { tmp := filepath.Join(t.TempDir(), "config.json") // Seed without MDM: VNC off, approval prompt on. - withMDMPolicy(t, mdm.NewPolicy(nil)) - _, err := UpdateOrCreateConfig(ConfigInput{ + configWithMDM(t, ConfigInput{ ConfigPath: tmp, ServerVNCAllowed: boolPtr(false), DisableVNCApproval: boolPtr(false), - }) - require.NoError(t, err) + }, mdm.NewPolicy(nil)) // MDM enforces VNC on and disables the approval prompt. - withMDMPolicy(t, mdm.NewPolicy(map[string]any{ + cfg := configWithMDM(t, ConfigInput{ + ConfigPath: tmp, + }, mdm.NewPolicy(map[string]any{ mdm.KeyAllowServerVNC: true, mdm.KeyDisableVNCApproval: true, })) - cfg, err := UpdateOrCreateConfig(ConfigInput{ConfigPath: tmp}) - require.NoError(t, err) - require.NotNil(t, cfg) - require.NotNil(t, cfg.ServerVNCAllowed) assert.True(t, *cfg.ServerVNCAllowed, "MDM override should flip on-disk false to true") require.NotNil(t, cfg.DisableVNCApproval)