mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-23 16:06:47 +00:00
Fix location service startup type (#4972)
* fix(tweaks): use canonical location service startup type * test(tweaks): pin location service startup type
This commit is contained in:
+1
-1
@@ -114,7 +114,7 @@
|
||||
"service": [
|
||||
{
|
||||
"Name": "lfsvc",
|
||||
"StartupType": "Disable",
|
||||
"StartupType": "Disabled",
|
||||
"OriginalType": "Manual"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -217,6 +217,16 @@ Describe "Tweaks config" {
|
||||
throw ($invalidTweaks -join "`n")
|
||||
}
|
||||
}
|
||||
|
||||
It "keeps the location service disabled" -TestCases $testCase {
|
||||
param([string]$Path)
|
||||
|
||||
$tweaks = Get-Content -Path $Path -Raw | ConvertFrom-Json
|
||||
$locationServices = @($tweaks.WPFTweaksLocation.service | Where-Object Name -eq "lfsvc")
|
||||
|
||||
$locationServices | Should -HaveCount 1
|
||||
$locationServices[0].StartupType | Should -Be "Disabled"
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Preset config" {
|
||||
@@ -428,6 +438,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")
|
||||
$supportedButtons = Get-WinUtilButtonSwitchNames
|
||||
$invalidEntries = New-Object System.Collections.Generic.List[string]
|
||||
|
||||
@@ -498,6 +509,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)'")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user