CI/CD: ci, deploy-ift и deploy-stage через EventHubDevOps; фиксы calendar view, archive, API-тесты, traefik-coraza
This commit is contained in:
@@ -43,7 +43,9 @@ test_create_single_event(Token, CalId) ->
|
||||
%% @doc GET /v1/calendars/:calendar_id/events?from=...&to=... – список с фильтром.
|
||||
test_list_events_with_dates(Token, CalId) ->
|
||||
ct:pal(" TEST: List events with date range"),
|
||||
Path = <<"/v1/calendars/", CalId/binary, "/events?from=2026-05-01T00:00:00Z&to=2026-07-01T00:00:00Z">>,
|
||||
{From, To} = api_test_runner:future_month_range_iso8601(),
|
||||
Path = <<"/v1/calendars/", CalId/binary, "/events?from=", From/binary,
|
||||
"&to=", To/binary>>,
|
||||
Events = api_test_runner:client_get(Path, Token),
|
||||
?assert(is_list(Events)),
|
||||
?assert(length(Events) >= 1),
|
||||
@@ -58,7 +60,7 @@ test_create_recurring_event(Token, CalId) ->
|
||||
Path = <<"/v1/calendars/", CalId/binary, "/events">>,
|
||||
Body = jsx:encode(#{
|
||||
title => <<"Weekly Meeting">>,
|
||||
start_time => api_test_runner:future_date_iso8601(),
|
||||
start_time => api_test_runner:next_month_start_iso8601(),
|
||||
duration => 60,
|
||||
recurrence => #{
|
||||
freq => <<"WEEKLY">>,
|
||||
@@ -70,11 +72,12 @@ test_create_recurring_event(Token, CalId) ->
|
||||
#{<<"id">> := RecurringId} = jsx:decode(list_to_binary(RespBody), [return_maps]),
|
||||
ct:pal(" Created recurring event ~s", [RecurringId]),
|
||||
|
||||
% Запрашиваем вхождения на месяц
|
||||
OccPath = <<"/v1/events/", RecurringId/binary, "/occurrences?from=2026-06-01T00:00:00Z&to=2026-06-30T00:00:00Z">>,
|
||||
{From, To} = api_test_runner:next_month_range_iso8601(),
|
||||
OccPath = <<"/v1/events/", RecurringId/binary, "/occurrences?from=", From/binary,
|
||||
"&to=", To/binary>>,
|
||||
Occs = api_test_runner:client_get(OccPath, Token),
|
||||
?assert(is_list(Occs)),
|
||||
?assert(length(Occs) >= 4), % минимум 4 недели в июне
|
||||
?assert(length(Occs) >= 4), % минимум 4 недели в полном месяце
|
||||
FirstOcc = hd(Occs),
|
||||
?assert(maps:is_key(<<"start_time">>, FirstOcc)),
|
||||
ct:pal(" OK: ~p occurrences found", [length(Occs)]).
|
||||
@@ -36,8 +36,9 @@ test() ->
|
||||
duration => 30,
|
||||
recurrence => #{freq => <<"WEEKLY">>, interval => 1}}),
|
||||
|
||||
% Получаем вхождения (ответ – список карт)
|
||||
OccPath = <<"/v1/events/", RecurringId/binary, "/occurrences?from=2026-06-01T00:00:00Z&to=2026-06-30T00:00:00Z">>,
|
||||
{From, To} = api_test_runner:future_month_range_iso8601(),
|
||||
OccPath = <<"/v1/events/", RecurringId/binary, "/occurrences?from=", From/binary,
|
||||
"&to=", To/binary>>,
|
||||
Occurrences = api_test_runner:client_get(OccPath, OwnerToken),
|
||||
?assert(is_list(Occurrences)),
|
||||
?assert(length(Occurrences) >= 1),
|
||||
|
||||
@@ -93,9 +93,9 @@ test_tag_filter(Token) ->
|
||||
|
||||
test_date_filter(Token) ->
|
||||
ct:pal(" TEST: Search with date range"),
|
||||
Events = extract_events(
|
||||
api_test_runner:client_get(
|
||||
<<"/v1/search?from=2026-06-01T00:00:00Z&to=2026-06-15T23:59:59Z">>, Token)),
|
||||
{From, To} = api_test_runner:future_month_range_iso8601(),
|
||||
Path = <<"/v1/search?from=", From/binary, "&to=", To/binary>>,
|
||||
Events = extract_events(api_test_runner:client_get(Path, Token)),
|
||||
?assert(is_list(Events)),
|
||||
?assert(length(Events) >= 1),
|
||||
ct:pal(" OK: ~p events", [length(Events)]).
|
||||
|
||||
Reference in New Issue
Block a user