TL;DR:
assert page_title(lv) =~ "my page title"
Phoenix LiveView has a live_title/1 component that allows us to easily update a page title and see those changes reflect in the browser.
They also have a page_title/1 function to test if your page title was updated using the page_title
assign.
You can use it to make sure you're assigning a page_title
to your pages:
def mount(_params, _session, socket) do
{:ok, assign(socket, :page_title, "My page title")}
end
Top comments (0)