8000 fix(test): use relative future dates in ICS test to avoid time bombs by mwoods79 · Pull Request #156 · huddlz-hq/huddlz · GitHub
[go: up one dir, main page]

Skip to content
10BC8
Merged
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
14 changes: 9 additions & 5 deletions test/huddlz/notifications/ics_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,25 @@ defmodule Huddlz.Notifications.ICSTest do
end

test "ics carries the huddl identity and timing", ctx do
date = Date.add(Date.utc_today(), 30)
start_time = ~T[14:00:00]
ymd = Calendar.strftime(date, "%Y%m%d")

huddl =
build_huddl(ctx,
title: "Coffee meetup",
description: "Casual chat",
date: ~D[2026-05-01],
start_time: ~T[14:00:00],
date: date,
start_time: start_time,
duration_minutes: 90
)

{_filename, ics} = ICS.event_for(huddl)

assert ics =~ "UID:huddl-#{huddl.id}@huddlz.com"
assert ics =~ "SUMMARY:Coffee meetup"
assert ics =~ "DTSTART:20260501T140000Z"
assert ics =~ "DTEND:20260501T153000Z"
assert ics =~ "DTSTART:#{ymd}T140000Z"
assert ics =~ "DTEND:#{ymd}T153000Z"
assert ics =~ "Casual chat"
end

Expand Down Expand Up @@ -83,7 +87,7 @@ defmodule Huddlz.Notifications.ICSTest do
huddl =
build_huddl(ctx,
title: "Roundtrip Test",
date: ~D[2026-06-15],
date: Date.add(Date.utc_today(), 45),
start_time: ~T[09:00:00],
duration_minutes: 60
)
Expand Down
Loading
0