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
7 changes: 6 additions & 1 deletion src/assets/templates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ function make_email_signature(name, role, email, phone)
Phone: {{phone}}
</div>
"""
return render(template, name=name, role=role, email=email, phone=phone)
return render(template, Dict(
"name" => name,
"role" => role,
"email" => email,
"phone" => phone,
))
end

"""
Expand Down
2 changes: 1 addition & 1 deletion src/crisis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end

function issue_holding_statement(playbook::CrisisPlaybook, variant_idx::Int)
statement = playbook.holding_statements[variant_idx]
return "STMT: "$statement""
return "STMT: \"$statement\""
end

end # module
4 changes: 3 additions & 1 deletion test/e2e_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ using Dates
@test variant isa AudienceVariant
@test variant.pillar_id == :camp_p

pr = draft_release(:camp_pr, "Big Launch Today", "We launch our product.")
pr = draft_release(:camp_pr, "Big Launch Today",
"We launch our product today with full availability across all " *
"supported regions starting at 09:00 UTC.")
review_release(pr)
@test pr.status == :review

Expand Down
4 changes: 3 additions & 1 deletion test/property_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ using PRComms
@testset "Invariant: draft_release always starts as draft" begin
for _ in 1:50
id = Symbol("pr$(rand(1:99999))")
pr = draft_release(id, "Title $(rand(1:99999))", "Body text")
pr = draft_release(id, "Title $(rand(1:99999))",
"Property-based test body that exceeds the fifty-character " *
"minimum length required by draft_release().")
@test pr.status == :draft
@test pr.embargo_at === nothing
end
Expand Down
15 changes: 9 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,35 +151,38 @@ using DataFrames
# Newsroom
# -----------------------------------------------------------------------
@testset "Newsroom" begin
sample_body = "We are excited to announce our launch with " *
"comprehensive details for press and partners."

@testset "draft_release" begin
pr = draft_release(:nr1, "Launch Day", "We are excited to announce...")
pr = draft_release(:nr1, "Launch Day", sample_body)
@test pr isa PressRelease
@test pr.id == :nr1
@test pr.title == "Launch Day"
@test pr.body == "We are excited to announce..."
@test pr.body == sample_body
@test pr.status == :draft
@test pr.embargo_at === nothing
@test pr.approved_at === nothing
end

@testset "review_release" begin
pr = draft_release(:nr2, "Review Test", "Body")
pr = draft_release(:nr2, "Review Test", sample_body)
result = review_release(pr)
@test result isa String
@test pr.status == :review
@test occursin("Review Test", result)
end

@testset "publish_release without embargo" begin
pr = draft_release(:nr3, "Publish Test", "Body")
pr = draft_release(:nr3, "Publish Test", sample_body)
result = publish_release(pr)
@test result isa String
@test pr.status == :published
@test occursin("LIVE", result)
end

@testset "publish_release with embargo" begin
pr = draft_release(:nr4, "Embargo Test", "Body")
pr = draft_release(:nr4, "Embargo Test", sample_body)
embargo_time = DateTime(2026, 6, 1, 9, 0)
result = publish_release(pr; embargo=embargo_time)
@test result isa String
Expand Down Expand Up @@ -278,7 +281,7 @@ using DataFrames
end

@testset "third_order_ratio" begin
@test third_order_ratio(0.8, 0.6, 2.0) == 0.1
@test third_order_ratio(0.8, 0.6, 2.0) 0.1
@test third_order_ratio(0.5, 0.5, 0) == 0.0 # divide by zero guard
end
end
Expand Down
Loading