Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Hide premium feature notice for trials (#3509)

Vinicius Brasile541f1a55f21
diff --git a/lib/plausible_web/components/billing.ex b/lib/plausible_web/components/billing.ex
index 10f86458bc..6628478b4e 100644
--- a/lib/plausible_web/components/billing.ex
+++ b/lib/plausible_web/components/billing.ex
@@ -29,11 +29,7 @@ defmodule PlausibleWeb.Components.Billing do
~H""
Plausible.Billing.on_trial?(assigns.billable_user) ->
- ~H"""
- <.notice class="rounded-t-md rounded-b-none" size={@size} {@rest}>
- <%= @feature_mod.display_name() %> is part of the Plausible Business plan. You can access it during your trial, but you'll need to subscribe to the Business plan to retain access after the trial ends."
- </.notice>
- """
+ ~H""
not has_access? ->
~H"""
diff --git a/test/plausible_web/components/billing_test.exs b/test/plausible_web/components/billing_test.exs
index f7b9fa53dc..23eaf5cd92 100644
--- a/test/plausible_web/components/billing_test.exs
+++ b/test/plausible_web/components/billing_test.exs
@@ -3,15 +3,14 @@ defmodule PlausibleWeb.Components.BillingTest do
import Phoenix.LiveViewTest
alias PlausibleWeb.Components.Billing
- test "premium_feature_notice/1 renders a message when user is on trial" do
+ test "premium_feature_notice/1 does not render a notice when user is on trial" do
me = insert(:user)
assert render_component(&Billing.premium_feature_notice/1,
billable_user: me,
current_user: me,
feature_mod: Plausible.Billing.Feature.Props
- ) =~
- "Custom Properties is part of the Plausible Business plan. You can access it during your trial"
+ ) == ""
end
test "premium_feature_notice/1 renders an upgrade link when user is the site owner and does not have access to the feature" do
diff --git a/test/plausible_web/controllers/site/membership_controller_test.exs b/test/plausible_web/controllers/site/membership_controller_test.exs
index 7e7a231386..a3f88bda08 100644
--- a/test/plausible_web/controllers/site/membership_controller_test.exs
+++ b/test/plausible_web/controllers/site/membership_controller_test.exs
@@ -22,8 +22,9 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do
end
test "disables invite form when is over limit", %{conn: conn, user: user} do
- memberships =
- [build(:site_membership, user: user, role: :owner) | build_list(5, :site_membership)]
+ memberships = [
+ build(:site_membership, user: user, role: :owner) | build_list(5, :site_membership)
+ ]
site = insert(:site, memberships: memberships)
@@ -53,8 +54,9 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do
end
test "fails to create invitation when is over limit", %{conn: conn, user: user} do
- memberships =
- [build(:site_membership, user: user, role: :owner) | build_list(5, :site_membership)]
+ memberships = [
+ build(:site_membership, user: user, role: :owner) | build_list(5, :site_membership)
+ ]
site = insert(:site, memberships: memberships)