Skip to content

Commit

Permalink
🧪 [Test]: Refactor disconnect context test to use specific context an…
Browse files Browse the repository at this point in the history
…d improve clarity
  • Loading branch information
MariusStorhaug committed Nov 25, 2024
1 parent 74d0d78 commit bd4fd12
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions tests/GitHub.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Describe 'GitHub' {

It 'Can reconfigure an existing context to be fine-grained PAT token' {
{ Connect-GitHubAccount -Token $env:TEST_FG_PAT } | Should -Not -Throw
$disconnectableContext = Get-GitHubContext
(Get-GitHubContext -ListAvailable).Count | Should -Be 2
Write-Verbose (Get-GitHubContext -ListAvailable | Out-String) -Verbose
}
Expand All @@ -50,11 +49,11 @@ Describe 'GitHub' {
}

It 'Can disconnect a specific context' {
Write-Verbose ($disconnectableContext | Select-Object *) -Verbose
$context = $disconnectableContext.HostName + '/' + $disconnectableContext.UserName
Write-Verbose $context -Verbose
{ Disconnect-GitHubAccount -Context $context -Silent } | Should -Not -Throw
{ Disconnect-GitHubAccount -Context 'github.com/github-actions[bot]' -Silent } | Should -Not -Throw
(Get-GitHubContext -ListAvailable).Count | Should -Be 2
Connect-GitHubAccount
Connect-GitHubAccount -ClientID $env:TEST_APP_CLIENT_ID -PrivateKey $env:TEST_APP_PRIVATE_KEY
(Get-GitHubContext -ListAvailable).Count | Should -Be 3
}

It 'Can swap context to another' {
Expand Down Expand Up @@ -114,11 +113,3 @@ Describe 'Commands' {
} | Should -Not -Throw
}
}

Describe 'Organization' {
Context 'Members' {
It 'Get-GitHubOrganizationMember can be called' {
Get-GitHubOrganizationMember -Organization 'PSModule' | Should -BeGreaterOrEqual 1
}
}
}

0 comments on commit bd4fd12

Please sign in to comment.