test: stop the start-menu restore specs sharing a restore copy (#801)

This commit is contained in:
HetCreep
2026-10-07 23:51:23 +02:00
committed by GitHub
parent 1b84f2d6fb
commit 386ae0c581
+5
View File
@@ -9,6 +9,11 @@ BeforeAll {
}
Describe 'Get-StartMenuUserNameFromPath' {
BeforeEach {
# Restore copies are named to the second; clear them so tests sharing $TestDrive cannot see each other's copy
Get-ChildItem -LiteralPath $TestDrive -Filter 'Win11Debloat-StartRestore-*.bak' | Remove-Item -Force
}
It 'extracts a user name from a start-menu path and falls back for unknown paths' {
Get-StartMenuUserNameFromPath -StartMenuBinFile 'C:\Users\Alice\AppData\Local\Packages\Start\start2.bin' | Should -Be 'Alice'
Get-StartMenuUserNameFromPath -StartMenuBinFile 'C:\Temp\start2.bin' | Should -Be 'unknown'