feat(BRIDGE-278): Rollout Feature Flag stickiness support; a new UUID 'sticky' value has been added to the vault"
This commit is contained in:
@ -56,6 +56,7 @@ import (
|
||||
imapid "github.com/emersion/go-imap-id"
|
||||
"github.com/emersion/go-sasl"
|
||||
"github.com/emersion/go-smtp"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
@ -778,6 +779,30 @@ func TestBridge_ChangeCacheDirectory(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestBridge_FeatureFlagStickyKey_Persistence(t *testing.T) {
|
||||
var uuidOne uuid.UUID
|
||||
var uuidTwo uuid.UUID
|
||||
|
||||
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, vaultKey []byte) {
|
||||
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, vaultKey, func(b *bridge.Bridge, _ *bridge.Mocks) {
|
||||
uuidOne = b.GetFeatureFlagStickyKey()
|
||||
})
|
||||
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, vaultKey, func(b *bridge.Bridge, _ *bridge.Mocks) {
|
||||
require.Equal(t, uuidOne, b.GetFeatureFlagStickyKey())
|
||||
})
|
||||
})
|
||||
|
||||
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, vaultKey []byte) {
|
||||
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, vaultKey, func(b *bridge.Bridge, _ *bridge.Mocks) {
|
||||
uuidTwo = b.GetFeatureFlagStickyKey()
|
||||
require.NotEqual(t, uuidOne, uuidTwo)
|
||||
})
|
||||
withBridge(ctx, t, s.GetHostURL(), netCtl, locator, vaultKey, func(b *bridge.Bridge, _ *bridge.Mocks) {
|
||||
require.Equal(t, uuidTwo, b.GetFeatureFlagStickyKey())
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func TestBridge_ChangeAddressOrder(t *testing.T) {
|
||||
withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, vaultKey []byte) {
|
||||
// Create a user.
|
||||
|
||||
Reference in New Issue
Block a user