Skip to content

Commit b2d4f26

Browse files
committed
test(project-item): update test cases to use MockCall_GetProject with -SkipItems parameter
1 parent 27ffafe commit b2d4f26

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎Test/public/issues/Add-IssuePullRequestComment.test.ps1‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ function Test_AddComment_SUCCESS_Using_Cache{
88
$contentId = $i.contentId
99
$comment = "sample comment 1"
1010

11-
MockCall_GetProject_700
11+
MockCall_GetProject -MockProject $p -SkipItems
12+
MockCall_GetItem -ItemId $i.id
1213

1314
Set-ProjectHelperEnvironment -Owner $owner -ProjectNumber $projectNumber -DisplayFields @("Status","FieldText")
1415

‎Test/public/project_item.test.ps1‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ function Test_GetProjectItem_SUCCESS{
1616
$itemFieldCommentValue = $projectFieldCommentValue + " updated"
1717

1818
# allow get project
19-
MockCall_GetProject_700
19+
MockCall_GetProject -MockProject $p -cache
20+
MockCall_GetProject -MockProject $p -SkipItems
21+
22+
MockCall_GetItem -ItemId $itemId
2023

2124
# Even if id is in project we make a direct call when with Force
2225
MockCallJson -Command "Invoke-GetItem -itemid $itemId" -FileName "invoke-getitem-$itemId-updated.json"
@@ -256,11 +259,12 @@ function Test_ShowProjectItem_SUCCESS{
256259
Reset-InvokeCommandMock
257260
Mock_DatabaseRoot
258261

259-
MockCall_GetProject_700
260-
261262
$p = Get-Mock_Project_700; $Owner = "octodemo" ; $ProjectNumber = 700
262-
263263
$i = $p.issue
264+
265+
MockCall_GetProject -MockProject $p -SkipItems
266+
MockCall_GetItem -ItemId $i.id
267+
264268
$id = $i.Id
265269
$title = $i.title
266270
$status = $i.status

0 commit comments

Comments
 (0)