mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-08-23 08:02:07 +00:00
Fix ForceRemoveEdge switch (#736)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
BeforeAll {
|
||||
function Import-RegistryFile { param($Message, $path) }
|
||||
function Remove-SelectedApps { param($Apps) }
|
||||
function Invoke-ForceRemoveEdge {}
|
||||
function Disable-TelemetryScheduledTasks {}
|
||||
function Enable-TelemetryScheduledTasks {}
|
||||
function Generate-AppsList { @() }
|
||||
@@ -51,6 +52,7 @@ Describe 'Invoke-FeatureApply' {
|
||||
RemoveApps = [PSCustomObject]@{ ApplyText = 'Remove apps'; RegistryKey = '' }
|
||||
RemoveGamingApps = [PSCustomObject]@{ ApplyText = 'Remove gaming'; RegistryKey = '' }
|
||||
RemoveHPApps = [PSCustomObject]@{ ApplyText = 'Remove HP'; RegistryKey = '' }
|
||||
ForceRemoveEdge = [PSCustomObject]@{ ApplyText = 'Force remove Edge'; RegistryKey = '' }
|
||||
DisableWidgets = [PSCustomObject]@{ ApplyText = 'Disable widgets'; RegistryKey = '' }
|
||||
EnableWindowsSandbox = [PSCustomObject]@{ ApplyText = 'Enable Sandbox'; RegistryKey = '' }
|
||||
EnableWindowsSubsystemForLinux = [PSCustomObject]@{ ApplyText = 'Enable WSL'; RegistryKey = '' }
|
||||
@@ -62,6 +64,7 @@ Describe 'Invoke-FeatureApply' {
|
||||
}
|
||||
Mock Import-RegistryFile {}
|
||||
Mock Remove-SelectedApps {}
|
||||
Mock Invoke-ForceRemoveEdge {}
|
||||
Mock Disable-TelemetryScheduledTasks {}
|
||||
Mock Generate-AppsList { @() }
|
||||
Mock Get-FriendlyTargetUserName { 'current user' }
|
||||
@@ -116,6 +119,14 @@ Describe 'Invoke-FeatureApply' {
|
||||
Should -Invoke Remove-SelectedApps -Times 1 -Exactly -ParameterFilter { @($Apps) -join ',' -eq $ExpectedApps -join ',' }
|
||||
}
|
||||
|
||||
It 'forcefully removes Edge when requested' {
|
||||
Invoke-FeatureApply -FeatureId 'ForceRemoveEdge'
|
||||
|
||||
Should -Invoke Invoke-ForceRemoveEdge -Times 1 -Exactly
|
||||
Should -Invoke Import-RegistryFile -Times 0 -Exactly
|
||||
Should -Invoke Remove-SelectedApps -Times 0 -Exactly
|
||||
}
|
||||
|
||||
It 'uses the expected static app list for <FeatureId>' -ForEach @(
|
||||
@{ FeatureId = 'RemoveGamingApps'; MinimumCount = 3; ExpectedApp = 'Microsoft.GamingApp' }
|
||||
@{ FeatureId = 'RemoveHPApps'; MinimumCount = 10; ExpectedApp = 'AD2F1837.myHP' }
|
||||
|
||||
Reference in New Issue
Block a user