We add support to assert and refute the page "title". The title is still visible by a user and is thus nice to support.
Because LiveView's render/1 only returns the body of the HTML, we have to use LiveViewTest'spage_title/1 helper to get the title.
To keep parity, we introduce a new render_page_title/1 driver function that we use in assertions to get the title of the page.
The assertion ignores whitespace when finding the title but the assertion only passes with equality. Thus, it doesn't match on a substring of the title.
Closes #4
What changed?
We add support to assert and refute the page "title". The title is still visible by a user and is thus nice to support.
Because LiveView's
render/1
only returns the body of the HTML, we have to use LiveViewTest'spage_title/1
helper to get the title.To keep parity, we introduce a new
render_page_title/1
driver function that we use in assertions to get the title of the page.The assertion ignores whitespace when finding the title but the assertion only passes with equality. Thus, it doesn't match on a substring of the title.