Skip to content

Commit

Permalink
remove flakyness
Browse files Browse the repository at this point in the history
  • Loading branch information
balanza committed Jul 29, 2024
1 parent 54cb9ba commit d3d4f86
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/trento/activity_log_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ defmodule Trento.ActivityLogTest do
assert length(logs) == 25
# default order is by inserted_at timestamp
all_logs_sorted =
all_logs |> Enum.sort_by(fn entry -> entry.inserted_at end, :desc) |> Enum.take(25)
all_logs |> Enum.sort_by(& &1.inserted_at, {:desc, DateTime}) |> Enum.take(25)

assert logs == all_logs_sorted
end
Expand All @@ -228,7 +228,7 @@ defmodule Trento.ActivityLogTest do

all_logs_sorted =
all_logs
|> Enum.sort_by(fn entry -> entry.inserted_at end, :desc)
|> Enum.sort_by(& &1.inserted_at, {:desc, DateTime})
|> Enum.drop(95)

assert length(all_logs_sorted) == length(logs)
Expand All @@ -245,7 +245,7 @@ defmodule Trento.ActivityLogTest do

all_logs_sorted =
all_logs
|> Enum.sort_by(fn entry -> entry.inserted_at end, :desc)
|> Enum.sort_by(& &1.inserted_at, {:desc, DateTime})
|> Enum.take(5)

assert length(all_logs_sorted) == length(logs)
Expand All @@ -265,7 +265,7 @@ defmodule Trento.ActivityLogTest do

next_logs_alt =
all_logs
|> Enum.sort_by(fn entry -> entry.inserted_at end, :desc)
|> Enum.sort_by(& &1.inserted_at, {:desc, DateTime})
|> Enum.drop(25)
|> Enum.take(25)

Expand All @@ -287,7 +287,7 @@ defmodule Trento.ActivityLogTest do

next_logs_alt =
all_logs
|> Enum.sort_by(fn entry -> entry.inserted_at end, :desc)
|> Enum.sort_by(& &1.inserted_at, {:desc, DateTime})
|> Enum.drop(20)
|> Enum.take(5)

Expand Down

0 comments on commit d3d4f86

Please sign in to comment.