Skip to content

Commit

Permalink
fix get-jcpolicygroupTemplate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jworkmanjc committed Nov 15, 2024
1 parent d87fb65 commit bf8f5f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Function Get-JCPolicyGroupTemplate {
}
}
$response = Invoke-JCApi -Method:('Get') -Paginate:($paginateRequired) -Url:($URL)
if ($response.totalCount -eq 0) {
$response = $null
}

}
end {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ Describe -Tag:('MSP') 'Get-JCPolicyGroupTemplate' {
$allPolicyGroupTemplates = Get-JCPolicyGroupTemplate
$allPolicyGroupTemplates | Should -Not -BeNullOrEmpty
}
It "Lists one configured template policies by ID" {
It "Lists one policy group template policies by ID" {
# get a single item:
$policyGroupTemplateResult = Get-JCPolicyGroupTemplate -GroupTemplateID $newPolicyGroupTemplate.id
$policyGroupTemplateResult | Should -Not -BeNullOrEmpty
$policyGroupTemplateResult.id | Should -Be $newPolicyGroupTemplate.id
$policyGroupTemplateResult.name | Should -Be $newPolicyGroupTemplate.name
$policyGroupTemplateResult.description | Should -Be $newPolicyGroupTemplate.description
}
It "Lists one configured template policies by Name" {
It "Lists one policy group template policies by Name" {
# get a single item:
$policyGroupTemplateResult = Get-JCConfiguredTemplatePolicy -Name $newPolicyGroupTemplate.name
$policyGroupTemplateResult = Get-JCPolicyGroupTemplate -Name $newPolicyGroupTemplate.name
$policyGroupTemplateResult | Should -Not -BeNullOrEmpty
$policyGroupTemplateResult.id | Should -Be $newPolicyGroupTemplate.id
$policyGroupTemplateResult.name | Should -Be $newPolicyGroupTemplate.name
Expand All @@ -55,7 +55,7 @@ Describe -Tag:('MSP') 'Get-JCPolicyGroupTemplate' {
{ Get-JCPolicyGroupTemplate -GroupTemplateID "111111111111111111111111" } | Should -Throw
}
It "Should return nothing if there is not an object found byName" {
$search = Get-JCConfiguredTemplatePolicy -Name "111111111111111111111111"
$search = Get-JCPolicyGroupTemplate -Name "111111111111111111111111"
$search | Should -BeNullOrEmpty
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ Describe -Tag:('JCPolicyGroup') 'Get-JCPolicyGroupMember' {
# response should return nothing
$policyGroupMembers | Should -Not -BeNullOrEmpty
}
It
}

0 comments on commit bf8f5f9

Please sign in to comment.