Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 PesterExplorer/Private/Get-PreviewPanel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function Get-PreviewPanel {
} else {
"white"
}
if($SelectedItem -like "*..") {
if($SelectedItem -eq '..') {
$formatSpectreAlignedSplat = @{
HorizontalAlignment = 'Center'
VerticalAlignment = 'Middle'
Expand Down
2 changes: 1 addition & 1 deletion PesterExplorer/Public/Show-PesterResult.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
15 changes: 15 additions & 0 deletions tests/Get-PreviewPanel.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down