mirror of
https://github.com/kieraneglin/pinchflat.git
synced 2026-01-23 02:24:24 +00:00
use css truncate everywhere and remove StringUtils.truncate function (#513)
Co-authored-by: robs <git@robs.social>
This commit is contained in:
parent
53e106dac2
commit
e9d365ee9e
14 changed files with 20 additions and 51 deletions
|
|
@ -28,20 +28,6 @@ defmodule Pinchflat.Utils.StringUtilsTest do
|
|||
end
|
||||
end
|
||||
|
||||
describe "truncate/2" do
|
||||
test "truncates a string to the given length and adds ..." do
|
||||
assert StringUtils.truncate("hello world", 5) == "hello..."
|
||||
end
|
||||
|
||||
test "breaks on a word boundary" do
|
||||
assert StringUtils.truncate("hello world", 7) == "hello..."
|
||||
end
|
||||
|
||||
test "does not truncate a string shorter than the given length" do
|
||||
assert StringUtils.truncate("hello", 10) == "hello"
|
||||
end
|
||||
end
|
||||
|
||||
describe "double_brace/1" do
|
||||
test "wraps a string in double braces" do
|
||||
assert StringUtils.double_brace("hello") == "{{ hello }}"
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ defmodule PinchflatWeb.Pages.JobTableLiveTest do
|
|||
{_source, media_item, _task, _job} = create_media_item_job()
|
||||
{:ok, _view, html} = live_isolated(conn, JobTableLive, session: %{})
|
||||
|
||||
assert html =~ StringUtils.truncate(media_item.title, 35)
|
||||
assert html =~ media_item.title
|
||||
end
|
||||
|
||||
test "shows a media item link", %{conn: conn} do
|
||||
|
|
@ -62,7 +62,7 @@ defmodule PinchflatWeb.Pages.JobTableLiveTest do
|
|||
{source, _task, _job} = create_source_job()
|
||||
{:ok, _view, html} = live_isolated(conn, JobTableLive, session: %{})
|
||||
|
||||
assert html =~ StringUtils.truncate(source.custom_name, 35)
|
||||
assert html =~ source.custom_name
|
||||
end
|
||||
|
||||
test "shows a source link", %{conn: conn} do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue