Missing files
This commit is contained in:
@@ -39,49 +39,15 @@ function Invoke-Json {
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "1) Health check"
|
||||
Write-Host "Health check..."
|
||||
Invoke-Json -Method GET -Path "/health" | Out-Host
|
||||
|
||||
Write-Host "`n2) Admin factory reset (clears players, suggestions, votes)"
|
||||
Write-Host "`nAdmin factory reset (clears players, suggestions, votes)..."
|
||||
Invoke-Json -Method POST -Path "/api/admin/factory-reset" -Headers @{ "X-Admin-Key" = $AdminKey } | Out-Host
|
||||
|
||||
Write-Host "`n3) Set player name"
|
||||
$me = Invoke-Json -Method POST -Path "/api/me/name" -Body @{ name = "SmokeTester" }
|
||||
$me | Out-Host
|
||||
# TODO
|
||||
|
||||
Write-Host "`n4) Submit three suggestions"
|
||||
$ids = @()
|
||||
1..3 | ForEach-Object {
|
||||
$resp = Invoke-Json -Method POST -Path "/api/suggestions" -Body @{
|
||||
name = "Game $_"
|
||||
genre = "Genre $_"
|
||||
description = "Autogenerated suggestion $_"
|
||||
}
|
||||
$ids += $resp.id
|
||||
$resp | Out-Host
|
||||
}
|
||||
|
||||
Write-Host "`n4b) Delete the third suggestion (Suggest phase only)"
|
||||
Invoke-Json -Method DELETE -Path "/api/suggestions/$($ids[2])" | Out-Host
|
||||
$ids = $ids[0..1]
|
||||
|
||||
Write-Host "`n5) Reveal phase"
|
||||
Invoke-Json -Method POST -Path "/api/admin/phase" -Headers @{ "X-Admin-Key" = $AdminKey } -Body @{ phase = "Reveal" } | Out-Host
|
||||
Invoke-Json -Method GET -Path "/api/suggestions/all" | Out-Host
|
||||
|
||||
Write-Host "`n6) Vote phase"
|
||||
Invoke-Json -Method POST -Path "/api/admin/phase" -Headers @{ "X-Admin-Key" = $AdminKey } -Body @{ phase = "Vote" } | Out-Host
|
||||
Invoke-Json -Method POST -Path "/api/votes" -Body @{ suggestionId = $ids[0]; score = 10 } | Out-Host
|
||||
Invoke-Json -Method POST -Path "/api/votes" -Body @{ suggestionId = $ids[1]; score = 7 } | Out-Host
|
||||
if ($ids.Count -ge 3) {
|
||||
Invoke-Json -Method POST -Path "/api/votes" -Body @{ suggestionId = $ids[2]; score = 5 } | Out-Host
|
||||
}
|
||||
|
||||
Write-Host "`n7) Results phase"
|
||||
Invoke-Json -Method POST -Path "/api/admin/phase" -Headers @{ "X-Admin-Key" = $AdminKey } -Body @{ phase = "Results" } | Out-Host
|
||||
Invoke-Json -Method GET -Path "/api/results" | Out-Host
|
||||
|
||||
Write-Host "`n8) Admin factory reset (clears players, suggestions, votes)"
|
||||
Write-Host "`nAdmin factory reset (clears players, suggestions, votes)..."
|
||||
Invoke-Json -Method POST -Path "/api/admin/factory-reset" -Headers @{ "X-Admin-Key" = $AdminKey } | Out-Host
|
||||
|
||||
Write-Host "`nSmoke test completed."
|
||||
|
||||
Reference in New Issue
Block a user