diff --git a/PesterExplorer/Private/Get-PreviewPanel.ps1 b/PesterExplorer/Private/Get-PreviewPanel.ps1 index 9042846..cc135ea 100644 --- a/PesterExplorer/Private/Get-PreviewPanel.ps1 +++ b/PesterExplorer/Private/Get-PreviewPanel.ps1 @@ -71,7 +71,7 @@ function Get-PreviewPanel { } else { "white" } - if($SelectedItem -like "*..") { + if($SelectedItem -eq '..') { $formatSpectreAlignedSplat = @{ HorizontalAlignment = 'Center' VerticalAlignment = 'Middle' diff --git a/PesterExplorer/Public/Show-PesterResult.ps1 b/PesterExplorer/Public/Show-PesterResult.ps1 index 759e19c..80b1325 100644 --- a/PesterExplorer/Public/Show-PesterResult.ps1 +++ b/PesterExplorer/Public/Show-PesterResult.ps1 @@ -122,7 +122,7 @@ function Show-PesterResult { if($items.Item($selectedItem).GetType().Name -eq "Test") { # This is a test. We don't want to go deeper. } - if($selectedItem -like '*..*') { + if($selectedItem -eq '..') { # Move up one via selecting .. $object = $stack.Pop() Write-Debug "Popped item from stack: $($object.Name)" diff --git a/tests/Get-PreviewPanel.tests.ps1 b/tests/Get-PreviewPanel.tests.ps1 index fdfae7c..f2c31a2 100644 --- a/tests/Get-PreviewPanel.tests.ps1 +++ b/tests/Get-PreviewPanel.tests.ps1 @@ -67,6 +67,21 @@ Describe 'Get-PreviewPanel' { } } + It 'should preview a test whose name ends with ".."' { + InModuleScope $env:BHProjectName { + $test = $script:run.Containers[0].Blocks[0].Order[0].Order[0] + $getPreviewPanelSplat = @{ + Items = [ordered]@{ '..' = @(); 'waits for retry...' = $test } + SelectedItem = 'waits for retry...' + PreviewHeight = $script:ContainerHeight + PreviewWidth = $script:ContainerWidth + } + $panel = Get-PreviewPanel @getPreviewPanelSplat + global:Get-RenderedText -Panel $panel | + Should -Not -BeLike "*Please select an item.*" + } + } + It 'should print warning when the screen is too small' { InModuleScope $env:BHProjectName { $Items = Get-ListFromObject -Object $script:run.Containers[0].Blocks[0].Order[0]