Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/tweaks.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"service": [
{
"Name": "lfsvc",
"StartupType": "Disable",
"StartupType": "Disabled",
"OriginalType": "Manual"
}
],
Expand Down
8 changes: 8 additions & 0 deletions pester/configs.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ Describe "UI-rendered config entries" {
$tweaks = Get-WinUtilConfigObject -Name "tweaks"
$requiredFields = @("Content", "category", "panel", "link")
$allowedTypes = @("Button", "Combobox", "Toggle", "ToggleButton")
$allowedServiceStartupTypes = @("Automatic", "AutomaticDelayedStart", "Disabled", "Manual")
Comment thread
coderabbitai[bot] marked this conversation as resolved.
$supportedButtons = Get-WinUtilButtonSwitchNames
$invalidEntries = New-Object System.Collections.Generic.List[string]

Expand Down Expand Up @@ -498,6 +499,13 @@ Describe "UI-rendered config entries" {
foreach ($missingField in (Get-WinUtilMissingRequiredFields -EntryName "$($entry.Name),service" -Entry $serviceEntry -RequiredFields @("Name", "StartupType", "OriginalType"))) {
$invalidEntries.Add($missingField)
}

foreach ($startupTypeField in @("StartupType", "OriginalType")) {
if ((Test-WinUtilHasNonEmptyProperty -Object $serviceEntry -Name $startupTypeField) -and
$allowedServiceStartupTypes -notcontains $serviceEntry.$startupTypeField) {
$invalidEntries.Add("$($entry.Name),service has unsupported $startupTypeField '$($serviceEntry.$startupTypeField)'")
}
}
}
}

Expand Down