Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmcg committed Feb 7, 2025
1 parent 65cf7db commit 794568b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion pkg/accessibility/accessibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import (
"github.com/cli/go-gh/v2/pkg/config"
)

const ACCESSIBILITY_ENV = "ACCESSIBILITY"
// ACCESSIBILITY_ENV is the name of the environment variable that can be used to enable
// accessibility features. If the value is empty, "0", or "false", the accessibility
// features are disabled. Any other value enables the accessibility features. Note that
// this environment variable supercedes the configuration file's accessible setting.
const ACCESSIBILITY_ENV = "GH_ACCESSIBILE"

// IsEnabled returns true if accessibility features are enabled via the ACCESSIBILITY
// environment variable or the configuration file.
Expand Down
6 changes: 3 additions & 3 deletions pkg/accessibility/accessibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestIsEnabled(t *testing.T) {
},
{
name: "When the accessibility configuration is unset and the ACCESSIBLE env var returns 'false', it should return false",
envVarValue: "0",
envVarValue: "false",
cfgStr: "",
wantOut: false,
},
Expand All @@ -58,7 +58,7 @@ func TestIsEnabled(t *testing.T) {
},
{
name: "When the accessibility configuration is set to enabled and the env var is set to '0', it should return false",
envVarValue: "false",
envVarValue: "0",
cfgStr: accessibilityEnabledConfig(),
wantOut: false,
},
Expand All @@ -71,7 +71,7 @@ func TestIsEnabled(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Setenv("ACCESSIBILITY", tt.envVarValue)
t.Setenv("GH_ACCESSIBILE", tt.envVarValue)
testutils.StubConfig(t, tt.cfgStr)
assert.Equal(t, tt.wantOut, IsEnabled())
})
Expand Down

0 comments on commit 794568b

Please sign in to comment.