remove data-qa
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-03-14 23:51:50 -04:00
parent c5e82c60b6
commit 8ef5147078
26 changed files with 288 additions and 91 deletions

View File

@ -70,7 +70,7 @@ defmodule MemexWeb.ContextLiveTest do
test "updates context in listing", %{conn: conn, context: context} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("[data-qa=\"context-edit-#{context.id}\"]") |> render_click() =~
assert index_live |> element(~s/a[aria-label="edit #{context.slug}"]/) |> render_click() =~
"edit"
assert_patch(index_live, Routes.context_index_path(conn, :edit, context.slug))
@ -92,7 +92,7 @@ defmodule MemexWeb.ContextLiveTest do
test "deletes context in listing", %{conn: conn, context: context} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("[data-qa=\"delete-context-#{context.id}\"]") |> render_click()
assert index_live |> element(~s/a[aria-label="delete #{context.slug}"]/) |> render_click()
refute has_element?(index_live, "#context-#{context.id}")
end
end
@ -137,7 +137,7 @@ defmodule MemexWeb.ContextLiveTest do
{:ok, index_live, _html} =
show_live
|> element("[data-qa=\"delete-context-#{context.id}\"]")
|> element(~s/button[aria-label="delete #{context.slug}"]/)
|> render_click()
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
@ -174,7 +174,7 @@ defmodule MemexWeb.ContextLiveTest do
assert html =~ "context"
assert html =~ Routes.note_show_path(Endpoint, :show, note_slug)
assert has_element?(show_live, "[data-qa=\"context-note-#{note_slug}\"]")
assert has_element?(show_live, "a", note_slug)
end
end
end

View File

@ -55,7 +55,9 @@ defmodule MemexWeb.InviteLiveTest do
test "updates invite in listing", %{conn: conn, invite: invite} do
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
assert index_live |> element("[data-qa=\"edit-#{invite.id}\"]") |> render_click() =~
assert index_live
|> element(~s/a[aria-label="edit invite for #{invite.name}"]/)
|> render_click() =~
gettext("edit invite")
assert_patch(index_live, Routes.invite_index_path(conn, :edit, invite))
@ -81,7 +83,10 @@ defmodule MemexWeb.InviteLiveTest do
test "deletes invite in listing", %{conn: conn, invite: invite} do
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
assert index_live |> element("[data-qa=\"delete-#{invite.id}\"]") |> render_click()
assert index_live
|> element(~s/a[aria-label="delete invite for #{invite.name}"]/)
|> render_click()
refute has_element?(index_live, "#invite-#{invite.id}")
end
end

View File

@ -75,7 +75,7 @@ defmodule MemexWeb.NoteLiveTest do
test "updates note in listing", %{conn: conn, note: note} do
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
assert index_live |> element("[data-qa=\"note-edit-#{note.id}\"]") |> render_click() =~
assert index_live |> element(~s/a[aria-label="edit #{note.slug}"]/) |> render_click() =~
"edit"
assert_patch(index_live, Routes.note_index_path(conn, :edit, note.slug))
@ -97,7 +97,7 @@ defmodule MemexWeb.NoteLiveTest do
test "deletes note in listing", %{conn: conn, note: note} do
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
assert index_live |> element("[data-qa=\"delete-note-#{note.id}\"]") |> render_click()
assert index_live |> element(~s/a[aria-label="delete #{note.slug}"]/) |> render_click()
refute has_element?(index_live, "#note-#{note.id}")
end
end
@ -138,7 +138,7 @@ defmodule MemexWeb.NoteLiveTest do
{:ok, index_live, _html} =
show_live
|> element("[data-qa=\"delete-note-#{note.id}\"]")
|> element(~s/button[aria-label="delete #{note.slug}"]/)
|> render_click()
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
@ -177,7 +177,7 @@ defmodule MemexWeb.NoteLiveTest do
assert html =~ "context"
assert html =~ Routes.note_show_path(Endpoint, :show, note_slug)
assert has_element?(show_live, "[data-qa=\"note-link-#{note_slug}\"]")
assert has_element?(show_live, "a", note_slug)
end
end
end

View File

@ -81,7 +81,7 @@ defmodule MemexWeb.PipelineLiveTest do
test "updates pipeline in listing", %{conn: conn, pipeline: pipeline} do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live |> element("[data-qa=\"pipeline-edit-#{pipeline.id}\"]") |> render_click() =~
assert index_live |> element(~s/a[aria-label="edit #{pipeline.slug}"]/) |> render_click() =~
"edit"
assert_patch(index_live, Routes.pipeline_index_path(conn, :edit, pipeline.slug))
@ -104,7 +104,7 @@ defmodule MemexWeb.PipelineLiveTest do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live
|> element("[data-qa=\"delete-pipeline-#{pipeline.id}\"]")
|> element(~s/a[aria-label="delete #{pipeline.slug}"]/)
|> render_click()
refute has_element?(index_live, "#pipeline-#{pipeline.id}")
@ -151,7 +151,7 @@ defmodule MemexWeb.PipelineLiveTest do
{:ok, index_live, _html} =
show_live
|> element("[data-qa=\"delete-pipeline-#{pipeline.id}\"]")
|> element(~s/button[aria-label="delete #{pipeline.slug}"]/)
|> render_click()
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
@ -161,9 +161,7 @@ defmodule MemexWeb.PipelineLiveTest do
test "creates a step", %{conn: conn, pipeline: pipeline} do
{:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline.slug))
show_live
|> element("[data-qa=\"add-step-#{pipeline.id}\"]")
|> render_click()
show_live |> element("a", "add step") |> render_click()
assert_patch(show_live, Routes.pipeline_show_path(conn, :add_step, pipeline.slug))
@ -199,7 +197,7 @@ defmodule MemexWeb.PipelineLiveTest do
{:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline.slug))
show_live
|> element("[data-qa=\"edit-step-#{step.id}\"]")
|> element(~s/a[aria-label="edit #{step.title}"]/)
|> render_click()
assert_patch(show_live, Routes.pipeline_show_path(conn, :edit_step, pipeline.slug, step.id))
@ -223,7 +221,7 @@ defmodule MemexWeb.PipelineLiveTest do
html =
show_live
|> element("[data-qa=\"delete-step-#{step.id}\"]")
|> element(~s/button[aria-label="delete #{step.title}"]/)
|> render_click()
assert_patch(show_live, Routes.pipeline_show_path(conn, :show, pipeline.slug))
@ -250,25 +248,25 @@ defmodule MemexWeb.PipelineLiveTest do
html =
show_live
|> element("[data-qa=\"move-step-up-#{second_step.id}\"]")
|> element(~s/button[aria-label="move #{second_step.title} up"]/)
|> render_click()
assert html =~ "1. second step"
assert html =~ "2. first step"
assert html =~ "3. third step"
refute has_element?(show_live, "[data-qa=\"move-step-up-#{second_step.id}\"]")
refute has_element?(show_live, ~s/button[aria-label="move #{second_step.title} up"]/)
html =
show_live
|> element("[data-qa=\"move-step-down-#{first_step.id}\"]")
|> element(~s/button[aria-label="move #{first_step.title} down"]/)
|> render_click()
assert html =~ "1. second step"
assert html =~ "2. third step"
assert html =~ "3. first step"
refute has_element?(show_live, "[data-qa=\"move-step-down-#{first_step.id}\"]")
refute has_element?(show_live, ~s/button[aria-label="move #{first_step.title} down"]/)
end
end
end