Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions test/pro/incident.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
load ../test_helper

setup() {
# 1h after with ISO 8601 format
expire_at="$(date -u -v+1H +%Y-%m-%dT%H:%M:%SZ)"
expire_after=3600
}

@test "create, get, states, update, close and restart" {
incident_id="$(./dist/urlscan pro incident create -o "example.com" --expire-at "$expire_at" | jq -r ".incident._id")"
incident_id="$(./dist/urlscan pro incident create -o "example.com" --expire-after "$expire_after" | jq -r ".incident._id")"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use expire-after after #133


run ./dist/urlscan pro incident get "$incident_id"
assert_success
Expand All @@ -32,7 +31,7 @@ setup() {


@test "copy" {
incident_id="$(./dist/urlscan pro incident create -o "example.com" --expire-at "$expire_at" | jq -r ".incident._id")"
incident_id="$(./dist/urlscan pro incident create -o "example.com" --expire-after "$expire_after" | jq -r ".incident._id")"
copied_id="$(./dist/urlscan pro incident copy "$incident_id" | jq -r ".incidents._id")"

run ./dist/urlscan pro incident get "$copied_id"
Expand All @@ -47,7 +46,7 @@ setup() {
}

@test "fork" {
incident_id="$(./dist/urlscan pro incident create -o "example.com" --expire-at "$expire_at" | jq -r ".incident._id")"
incident_id="$(./dist/urlscan pro incident create -o "example.com" --expire-after "$expire_after" | jq -r ".incident._id")"
forked_id="$(./dist/urlscan pro incident fork "$incident_id" | jq -r ".incidents._id")"

run ./dist/urlscan pro incident get "$forked_id"
Expand Down
2 changes: 1 addition & 1 deletion test/version.bats
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ load test_helper

@test "version" {
run ./dist/urlscan version
assert_output "urlscan-cli $VERSION"
assert_line "urlscan-cli $VERSION"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert_output is exact match. So should use partial match (assert_line) after #117.

}
Loading