From 10003c34f662a8746adb42036613b24f699de664 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 10 Oct 2024 07:59:33 +0100 Subject: [PATCH] Include timestamps in record detail page --- lib/music_library_web/live/record_live/show.html.heex | 2 ++ test/music_library_web/live/record_show_test.exs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/music_library_web/live/record_live/show.html.heex b/lib/music_library_web/live/record_live/show.html.heex index 99abc64c..0d09a29b 100644 --- a/lib/music_library_web/live/record_live/show.html.heex +++ b/lib/music_library_web/live/record_live/show.html.heex @@ -43,6 +43,8 @@ <%= genre %> + <:item title="Inserted at"><%= @record.inserted_at %> + <:item title="Updated at"><%= @record.updated_at %> diff --git a/test/music_library_web/live/record_show_test.exs b/test/music_library_web/live/record_show_test.exs index 5f578426..1ca252bf 100644 --- a/test/music_library_web/live/record_show_test.exs +++ b/test/music_library_web/live/record_show_test.exs @@ -36,6 +36,8 @@ defmodule MusicLibraryWeb.RecordShowTest do assert html =~ Record.format_short_label(record.format) assert html =~ record.release assert html =~ ~p"/covers/#{record.id}?vsn=#{record.cover_hash}" + assert html =~ Phoenix.HTML.Safe.to_iodata(record.inserted_at) + assert html =~ Phoenix.HTML.Safe.to_iodata(record.updated_at) for artist <- record.artists do assert html =~ escape(artist["name"])