Explain the recommended media server list when setting one up
Show a short hint above the media server list on first-time setup, mirroring the relay list hint.
This commit is contained in:
2 files changed
+19
No files matched your search
@@ -1,5 +1,10 @@
|
||||
<div class="w-[72vw] md:w-[500px]">
|
||||
<h3 class="mb-6">Edit media servers</h3>
|
||||
<% if @media_list_event.blank? %>
|
||||
<p class="mb-4 text-gray-500">
|
||||
These are the servers that host the larger files you share — images, videos and other attachments that don't fit in a regular event. Here's a recommended server to start with:
|
||||
</p>
|
||||
<% end %>
|
||||
<%= form_with url: "#", local: true,
|
||||
html: { data: {
|
||||
controller: "url-list-editor",
|
||||
|
||||
@@ -33,6 +33,13 @@ RSpec.describe Settings::NostrEditMediaServersComponent, type: :component do
|
||||
badges = rendered.css("span.rounded-full").select { |el| el.text.strip == "added" }
|
||||
expect(badges.size).to eq(1)
|
||||
end
|
||||
|
||||
it "shows a hint about the recommended list" do
|
||||
rendered = render_inline(described_class.new(media_list_event: nil))
|
||||
|
||||
hint = rendered.css("p").find { |el| el.text.include?("recommended server to start with") }
|
||||
expect(hint).to be_present
|
||||
end
|
||||
end
|
||||
|
||||
describe "when user has an existing media server list without the site server" do
|
||||
@@ -53,6 +60,13 @@ RSpec.describe Settings::NostrEditMediaServersComponent, type: :component do
|
||||
badges = rendered.css("span.rounded-full").select { |el| el.text.strip == "added" }
|
||||
expect(badges.size).to eq(1)
|
||||
end
|
||||
|
||||
it "does not show the hint" do
|
||||
rendered = render_inline(described_class.new(media_list_event: media_list_event))
|
||||
|
||||
hint = rendered.css("p").find { |el| el.text.include?("recommended server to start with") }
|
||||
expect(hint).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe "when user already has the site server" do
|
||||
|
||||
Reference in new issue
Block a user