Skip to content

Commit

Permalink
Tweak test for dynamic_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurClemens committed Aug 12, 2023
1 parent 31d6f99 commit 040cf79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@ jobs:
otp: ['26']
elixir: ['1.15.4']
steps:
- name: Clear cache
uses: actions/github-script@v6
with:
script: |
console.log("About to clear")
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
})
for (const cache of caches.data.actions_caches) {
console.log(cache)
github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
}
console.log("Clear completed")
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
Expand Down
29 changes: 14 additions & 15 deletions test/components/truncate_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,19 @@ defmodule PrimerLive.Components.TruncateTest do
test "Attribute: style" do
assigns = %{}

assert rendered_to_string(~H"""
<.truncate>
<:item is_expandable style="max-width: 300px;">
really-long-text
</:item>
</.truncate>
""")
|> format_html() ==
"""
<span class="Truncate">
<span class="Truncate-text Truncate-text--expandable"
style="max-width: 300px;">really-long-text</span>
</span>
"""
|> format_html()
# Assert with rendered fragments because .dynamic_tag shuffles the order of attributes
result =
rendered_to_string(~H"""
<.truncate>
<:item is_expandable style="max-width: 300px;">
really-long-text
</:item>
</.truncate>
""")
|> format_html()

assert String.contains?(result, "<span class=\"Truncate\">")
assert String.contains?(result, "style=\"max-width: 300px;\"")
assert String.contains?(result, "class=\"Truncate-text Truncate-text--expandable\"")
end
end

0 comments on commit 040cf79

Please sign in to comment.