mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
GODT-2221: Set DOH off by default.
This commit is contained in:
@ -536,8 +536,8 @@ func withBridge(
|
|||||||
mocks := bridge.NewMocks(t, v2_3_0, v2_3_0)
|
mocks := bridge.NewMocks(t, v2_3_0, v2_3_0)
|
||||||
defer mocks.Close()
|
defer mocks.Close()
|
||||||
|
|
||||||
// Bridge will enable the proxy by default at startup.
|
// Bridge will disable the proxy by default at startup.
|
||||||
mocks.ProxyCtl.EXPECT().AllowProxy()
|
mocks.ProxyCtl.EXPECT().DisallowProxy()
|
||||||
|
|
||||||
// Get the path to the vault.
|
// Get the path to the vault.
|
||||||
vaultDir, err := locator.ProvideSettingsPath()
|
vaultDir, err := locator.ProvideSettingsPath()
|
||||||
|
|||||||
@ -119,14 +119,14 @@ func TestBridge_Settings_Proxy(t *testing.T) {
|
|||||||
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, storeKey []byte) {
|
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, storeKey []byte) {
|
||||||
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, storeKey, func(bridge *bridge.Bridge, mocks *bridge.Mocks) {
|
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, storeKey, func(bridge *bridge.Bridge, mocks *bridge.Mocks) {
|
||||||
// By default, proxy is allowed.
|
// By default, proxy is allowed.
|
||||||
require.True(t, bridge.GetProxyAllowed())
|
require.False(t, bridge.GetProxyAllowed())
|
||||||
|
|
||||||
// Disallow proxy.
|
// Disallow proxy.
|
||||||
mocks.ProxyCtl.EXPECT().DisallowProxy()
|
mocks.ProxyCtl.EXPECT().AllowProxy()
|
||||||
require.NoError(t, bridge.SetProxyAllowed(false))
|
require.NoError(t, bridge.SetProxyAllowed(true))
|
||||||
|
|
||||||
// Get the new setting.
|
// Get the new setting.
|
||||||
require.False(t, bridge.GetProxyAllowed())
|
require.True(t, bridge.GetProxyAllowed())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -124,13 +124,13 @@ func TestVault_Settings_ProxyAllowed(t *testing.T) {
|
|||||||
s := newVault(t)
|
s := newVault(t)
|
||||||
|
|
||||||
// Check the default proxy allowed setting.
|
// Check the default proxy allowed setting.
|
||||||
require.Equal(t, true, s.GetProxyAllowed())
|
require.Equal(t, false, s.GetProxyAllowed())
|
||||||
|
|
||||||
// Modify the proxy allowed setting.
|
// Modify the proxy allowed setting.
|
||||||
require.NoError(t, s.SetProxyAllowed(false))
|
require.NoError(t, s.SetProxyAllowed(true))
|
||||||
|
|
||||||
// Check the new proxy allowed setting.
|
// Check the new proxy allowed setting.
|
||||||
require.Equal(t, false, s.GetProxyAllowed())
|
require.Equal(t, true, s.GetProxyAllowed())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestVault_Settings_ShowAllMail(t *testing.T) {
|
func TestVault_Settings_ShowAllMail(t *testing.T) {
|
||||||
|
|||||||
@ -76,7 +76,7 @@ func newDefaultSettings(gluonDir string) Settings {
|
|||||||
UpdateRollout: rand.Float64(), //nolint:gosec
|
UpdateRollout: rand.Float64(), //nolint:gosec
|
||||||
|
|
||||||
ColorScheme: "",
|
ColorScheme: "",
|
||||||
ProxyAllowed: true,
|
ProxyAllowed: false,
|
||||||
ShowAllMail: true,
|
ShowAllMail: true,
|
||||||
Autostart: true,
|
Autostart: true,
|
||||||
AutoUpdate: true,
|
AutoUpdate: true,
|
||||||
|
|||||||
@ -90,8 +90,8 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
|
|||||||
return nil, fmt.Errorf("bridge is already started")
|
return nil, fmt.Errorf("bridge is already started")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bridge will enable the proxy by default at startup.
|
// Bridge will disable the proxy by default at startup.
|
||||||
t.mocks.ProxyCtl.EXPECT().AllowProxy()
|
t.mocks.ProxyCtl.EXPECT().DisallowProxy()
|
||||||
|
|
||||||
// Get the path to the vault.
|
// Get the path to the vault.
|
||||||
vaultDir, err := t.locator.ProvideSettingsPath()
|
vaultDir, err := t.locator.ProvideSettingsPath()
|
||||||
|
|||||||
Reference in New Issue
Block a user