refactor(configmanager): simplify SecureStore UI with unified info view
Consolidate SecureStoreLockedFormView and SecureStoreUnlockedFormView into a single SecureStoreInfoFormView that displays store status and metadata. Simplifies MainWindowViewModel by removing redundant state management. Also adds design docs for RegexTransformer feature.
This commit is contained in:
@@ -222,7 +222,6 @@ public class TreeNodeViewModelTests
|
||||
#region SecureStore Node Type Tests
|
||||
|
||||
[Theory]
|
||||
[InlineData(TreeNodeType.SecureStoresFolder)]
|
||||
[InlineData(TreeNodeType.SecureStore)]
|
||||
[InlineData(TreeNodeType.Secret)]
|
||||
public void Constructor_WithSecureStoreNodeTypes_SetsNodeTypeCorrectly(TreeNodeType nodeType)
|
||||
@@ -234,119 +233,6 @@ public class TreeNodeViewModelTests
|
||||
sut.NodeType.ShouldBe(nodeType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsUnlocked_DefaultsToFalse()
|
||||
{
|
||||
// Arrange & Act
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
|
||||
// Assert
|
||||
sut.IsUnlocked.ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsUnlocked_WhenSet_RaisesPropertyChanged()
|
||||
{
|
||||
// Arrange
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
var propertyChangedRaised = false;
|
||||
sut.PropertyChanged += (s, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(TreeNodeViewModel.IsUnlocked))
|
||||
propertyChangedRaised = true;
|
||||
};
|
||||
|
||||
// Act
|
||||
sut.IsUnlocked = true;
|
||||
|
||||
// Assert
|
||||
propertyChangedRaised.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsUnlocked_WhenSet_RaisesPropertyChangedForLockIcon()
|
||||
{
|
||||
// Arrange
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
var lockIconChanged = false;
|
||||
sut.PropertyChanged += (s, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(TreeNodeViewModel.LockIcon))
|
||||
lockIconChanged = true;
|
||||
};
|
||||
|
||||
// Act
|
||||
sut.IsUnlocked = true;
|
||||
|
||||
// Assert
|
||||
lockIconChanged.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LockIcon_WhenLocked_ReturnsLockedIcon()
|
||||
{
|
||||
// Arrange & Act
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
|
||||
// Assert
|
||||
sut.LockIcon.ShouldBe("🔒");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LockIcon_WhenUnlocked_ReturnsUnlockedIcon()
|
||||
{
|
||||
// Arrange
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
|
||||
// Act
|
||||
sut.IsUnlocked = true;
|
||||
|
||||
// Assert
|
||||
sut.LockIcon.ShouldBe("🔓");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsLocked_WhenUnlocked_ReturnsFalse()
|
||||
{
|
||||
// Arrange
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
|
||||
// Act
|
||||
sut.IsUnlocked = true;
|
||||
|
||||
// Assert
|
||||
sut.IsLocked.ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsLocked_WhenLocked_ReturnsTrue()
|
||||
{
|
||||
// Arrange & Act
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
|
||||
// Assert
|
||||
sut.IsLocked.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsUnlocked_WhenSet_RaisesPropertyChangedForIsLocked()
|
||||
{
|
||||
// Arrange
|
||||
var sut = new TreeNodeViewModel("Store", "🔒", TreeNodeType.SecureStore);
|
||||
var isLockedChanged = false;
|
||||
sut.PropertyChanged += (s, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(TreeNodeViewModel.IsLocked))
|
||||
isLockedChanged = true;
|
||||
};
|
||||
|
||||
// Act
|
||||
sut.IsUnlocked = true;
|
||||
|
||||
// Assert
|
||||
isLockedChanged.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StorePath_CanBeSetViaInitializer()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user