defmodule Medicode.SidebarComponentTest do use MedicodeWeb.ConnCase, async: true import Phoenix.LiveViewTest import Medicode.{ AccountsFixtures, TranscriptionsFixtures } alias MedicodeWeb.Components.SidebarComponent describe "SidebarComponent" do setup do user = user_fixture() transcription_fixture(%{user: user, filename: "Transcript #1"}) transcription_fixture(%{user: user, filename: "Transcript #2"}) transcription_fixture(%{filename: "Transcript #3"}) %{user: user} end test "renders a list of transcriptions for current user", %{user: user} do html = render_component(SidebarComponent, id: 1, current_user: user) assert html =~ "Transcript #1" assert html =~ "Transcript #2" refute html =~ "Transcript #3" end end end