-
-
Notifications
You must be signed in to change notification settings - Fork 814
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add all pr commands and short commands - Add test for filtering params Implements #549 Not implemented in this PR: 'subgroups' (work-items set-vote policies)
- Loading branch information
Showing
4 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
. $PSScriptRoot\Shared.ps1 | ||
|
||
Describe 'ParamsTabExpansion VSTS Tests' { | ||
Context 'Push Parameters TabExpansion Tests' { | ||
# Create a git alias for 'pr', as if we'd installed vsts-cli | ||
BeforeEach { | ||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')] | ||
$origPath = Get-Location | ||
$temp = [System.IO.Path]::GetTempPath() | ||
$repoPath = Join-Path $temp ([IO.Path]::GetRandomFileName()) | ||
|
||
&$gitbin init $repoPath | ||
Set-Location $repoPath | ||
|
||
&$gitbin config alias.pr "!f() { exec vsts code pr \`"`$`@\`"; }; f" | ||
} | ||
AfterEach { | ||
Set-Location $origPath | ||
if (Test-Path $repoPath) { | ||
Remove-Item $repoPath -Recurse -Force | ||
} | ||
} | ||
|
||
It 'Tab completes git pr create parameters values' { | ||
$result = & $module GitTabExpansionInternal 'git pr create --' | ||
$result -contains '--auto-complete' | Should Be $true | ||
} | ||
It 'Tab completes git pr create auto-complete parameters values' { | ||
$result = & $module GitTabExpansionInternal 'git pr create --auto-complete --' | ||
$result -contains '--delete-source-branch' | Should Be $true | ||
} | ||
It 'Tab completes git pr create all short push parameters' { | ||
$result = & $module GitTabExpansionInternal 'git pr create -' | ||
$result -contains '-d' | Should Be $true | ||
$result -contains '-i' | Should Be $true | ||
$result -contains '-p' | Should Be $true | ||
$result -contains '-r' | Should Be $true | ||
$result -contains '-s' | Should Be $true | ||
$result -contains '-h' | Should Be $true | ||
$result -contains '-o' | Should Be $true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters