Improve assertion of the session creation timestamp

This commit is contained in:
Jonatan Kłosko 2022-08-11 13:42:33 +02:00
parent d59e2cf4b9
commit d0338be513
2 changed files with 3 additions and 10 deletions

View file

@ -124,7 +124,7 @@
}
.switch-button {
@apply relative inline-block w-14 h-7 mr-2 select-none transition;
@apply relative inline-block w-14 h-7 mr-2 select-none;
}
.switch-button--disabled {

View file

@ -781,16 +781,9 @@ defmodule Livebook.SessionTest do
end
end
test "session has created_at attribute when it is created", %{session: session} do
assert Map.has_key?(session, :created_at)
end
test "session created_at attribute is a date time", %{session: session} do
test "session has the creation timestamp", %{session: session} do
assert %DateTime{} = session.created_at
end
test "session created_at is before now", %{session: session} do
assert DateTime.compare(session.created_at, DateTime.utc_now()) == :lt
assert DateTime.compare(session.created_at, DateTime.utc_now()) in [:lt, :eq]
end
@tag :tmp_dir