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:
+42
-11
@@ -11,28 +11,45 @@ public class ExcelExportFormViewModelTests
|
||||
// Arrange
|
||||
var model = new ExcelExportSection
|
||||
{
|
||||
CriteriaSheetPassword = "criteriaPass123",
|
||||
DataSheetPassword = "dataPass456",
|
||||
MaxRowsPerSheet = 500000,
|
||||
DefaultDateFormat = "MM/dd/yyyy",
|
||||
DebugWriteToFile = true,
|
||||
DebugOutputDirectory = "/tmp/debug",
|
||||
TimezoneId = "America/New_York",
|
||||
TimezoneAbbreviation = "ET"
|
||||
TimezoneId = "America/Los_Angeles"
|
||||
};
|
||||
|
||||
// Act
|
||||
var sut = new ExcelExportFormViewModel(model, () => { });
|
||||
|
||||
// Assert
|
||||
sut.CriteriaSheetPassword.ShouldBe("criteriaPass123");
|
||||
sut.DataSheetPassword.ShouldBe("dataPass456");
|
||||
sut.MaxRowsPerSheet.ShouldBe(500000);
|
||||
sut.DefaultDateFormat.ShouldBe("MM/dd/yyyy");
|
||||
sut.DebugWriteToFile.ShouldBeTrue();
|
||||
sut.DebugOutputDirectory.ShouldBe("/tmp/debug");
|
||||
sut.TimezoneId.ShouldBe("America/New_York");
|
||||
sut.TimezoneAbbreviation.ShouldBe("ET");
|
||||
sut.SelectedTimezone.ShouldBe("America/Los_Angeles");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_UsesModelTimezone()
|
||||
{
|
||||
// Arrange - model defaults to "America/Chicago"
|
||||
var model = new ExcelExportSection();
|
||||
|
||||
// Act
|
||||
var sut = new ExcelExportFormViewModel(model, () => { });
|
||||
|
||||
// Assert
|
||||
sut.SelectedTimezone.ShouldBe("America/Chicago");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AvailableTimezones_ContainsSystemTimezones()
|
||||
{
|
||||
// Act & Assert
|
||||
ExcelExportFormViewModel.AvailableTimezones.ShouldNotBeEmpty();
|
||||
// Check for common IANA timezones
|
||||
ExcelExportFormViewModel.AvailableTimezones.ShouldContain("America/Chicago");
|
||||
ExcelExportFormViewModel.AvailableTimezones.ShouldContain("UTC");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -49,16 +66,30 @@ public class ExcelExportFormViewModelTests
|
||||
model.MaxRowsPerSheet.ShouldBe(750000);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelectedTimezone_UpdatesModelTimezoneId()
|
||||
{
|
||||
// Arrange - model defaults to "America/Chicago"
|
||||
var model = new ExcelExportSection();
|
||||
var sut = new ExcelExportFormViewModel(model, () => { });
|
||||
|
||||
// Act - change to a different timezone
|
||||
sut.SelectedTimezone = "America/New_York";
|
||||
|
||||
// Assert
|
||||
model.TimezoneId.ShouldBe("America/New_York");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PropertyChange_InvokesOnChanged()
|
||||
{
|
||||
// Arrange
|
||||
var model = new ExcelExportSection();
|
||||
var model = new ExcelExportSection(); // Default TimezoneId is "America/Chicago"
|
||||
var changedInvoked = false;
|
||||
var sut = new ExcelExportFormViewModel(model, () => changedInvoked = true);
|
||||
|
||||
// Act
|
||||
sut.TimezoneId = "Europe/London";
|
||||
// Act - change to a different timezone than the default
|
||||
sut.SelectedTimezone = "America/Denver";
|
||||
|
||||
// Assert
|
||||
changedInvoked.ShouldBeTrue();
|
||||
|
||||
Reference in New Issue
Block a user