Update plans_v4.json with new plans IDs (#3436)

* Update plans_v4.json with new plans IDs

* Fix failing tests

---------

Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
This commit is contained in:
Vini Brasil 2023-10-18 05:48:47 -03:00 committed by GitHub
parent 7674c94ace
commit 3b0322670b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 84 additions and 99 deletions

View File

@ -2,8 +2,8 @@
{
"kind":"growth",
"monthly_pageview_limit":10000,
"monthly_product_id":"change-me-749342",
"yearly_product_id":"change-me-749343",
"monthly_product_id":"857097",
"yearly_product_id":"857079",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -11,8 +11,8 @@
{
"kind":"growth",
"monthly_pageview_limit":100000,
"monthly_product_id":"change-me-749344",
"yearly_product_id":"change-me-749345",
"monthly_product_id":"857098",
"yearly_product_id":"857080",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -20,8 +20,8 @@
{
"kind":"growth",
"monthly_pageview_limit":200000,
"monthly_product_id":"change-me-749346",
"yearly_product_id":"change-me-749347",
"monthly_product_id":"857099",
"yearly_product_id":"857081",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -29,8 +29,8 @@
{
"kind":"growth",
"monthly_pageview_limit":500000,
"monthly_product_id":"change-me-749348",
"yearly_product_id":"change-me-749349",
"monthly_product_id":"857100",
"yearly_product_id":"857082",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -38,8 +38,8 @@
{
"kind":"growth",
"monthly_pageview_limit":1000000,
"monthly_product_id":"change-me-749350",
"yearly_product_id":"change-me-749352",
"monthly_product_id":"857101",
"yearly_product_id":"857083",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -47,8 +47,8 @@
{
"kind":"growth",
"monthly_pageview_limit":2000000,
"monthly_product_id":"change-me-749353",
"yearly_product_id":"change-me-749355",
"monthly_product_id":"857102",
"yearly_product_id":"857084",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -56,8 +56,8 @@
{
"kind":"growth",
"monthly_pageview_limit":5000000,
"monthly_product_id":"change-me-749356",
"yearly_product_id":"change-me-749357",
"monthly_product_id":"857103",
"yearly_product_id":"857085",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -65,8 +65,8 @@
{
"kind":"growth",
"monthly_pageview_limit":10000000,
"monthly_product_id":"change-me-749358",
"yearly_product_id":"change-me-749359",
"monthly_product_id":"857104",
"yearly_product_id":"857086",
"site_limit":10,
"team_member_limit":5,
"features":["goals"]
@ -74,8 +74,8 @@
{
"kind":"business",
"monthly_pageview_limit":10000,
"monthly_product_id":"change-me-b749342",
"yearly_product_id":"change-me-b749343",
"monthly_product_id":"857105",
"yearly_product_id":"857087",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]
@ -83,8 +83,8 @@
{
"kind":"business",
"monthly_pageview_limit":100000,
"monthly_product_id":"change-me-b749344",
"yearly_product_id":"change-me-b749345",
"monthly_product_id":"857106",
"yearly_product_id":"857088",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]
@ -92,8 +92,8 @@
{
"kind":"business",
"monthly_pageview_limit":200000,
"monthly_product_id":"change-me-b749346",
"yearly_product_id":"change-me-b749347",
"monthly_product_id":"857107",
"yearly_product_id":"857089",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]
@ -101,8 +101,8 @@
{
"kind":"business",
"monthly_pageview_limit":500000,
"monthly_product_id":"change-me-b749348",
"yearly_product_id":"change-me-b749349",
"monthly_product_id":"857108",
"yearly_product_id":"857090",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]
@ -110,8 +110,8 @@
{
"kind":"business",
"monthly_pageview_limit":1000000,
"monthly_product_id":"change-me-b749350",
"yearly_product_id":"change-me-b749352",
"monthly_product_id":"857109",
"yearly_product_id":"857091",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]
@ -119,8 +119,8 @@
{
"kind":"business",
"monthly_pageview_limit":2000000,
"monthly_product_id":"change-me-b749353",
"yearly_product_id":"change-me-b749355",
"monthly_product_id":"857110",
"yearly_product_id":"857092",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]
@ -128,8 +128,8 @@
{
"kind":"business",
"monthly_pageview_limit":5000000,
"monthly_product_id":"change-me-b749356",
"yearly_product_id":"change-me-b749357",
"monthly_product_id":"857111",
"yearly_product_id":"857093",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]
@ -137,8 +137,8 @@
{
"kind":"business",
"monthly_pageview_limit":10000000,
"monthly_product_id":"change-me-b749358",
"yearly_product_id":"change-me-b749359",
"monthly_product_id":"857112",
"yearly_product_id":"857094",
"site_limit":50,
"team_member_limit":50,
"features":["goals","props","revenue_goals","funnels","stats_api"]

View File

@ -2,8 +2,6 @@ defmodule Plausible.AuthTest do
use Plausible.DataCase, async: true
alias Plausible.Auth
@v4_growth_plan_id "change-me-749342"
describe "user_completed_setup?" do
test "is false if user does not have any sites" do
user = insert(:user)
@ -72,7 +70,7 @@ defmodule Plausible.AuthTest do
end
test "returns error when user is on a growth plan" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
assert {:error, :upgrade_required} =
Auth.create_api_key(user, "my new key", Ecto.UUID.generate())

View File

@ -2,8 +2,6 @@ defmodule Plausible.Billing.FeatureTest do
use Plausible.DataCase
@v1_plan_id "558018"
@v4_growth_plan_id "change-me-749342"
@v4_business_plan_id "change-me-b749342"
for mod <- [Plausible.Billing.Feature.Funnels, Plausible.Billing.Feature.RevenueGoals] do
test "#{mod}.check_availability/1 returns :ok when site owner is on a enterprise plan" do
@ -17,14 +15,13 @@ defmodule Plausible.Billing.FeatureTest do
end
test "#{mod}.check_availability/1 returns :ok when site owner is on a business plan" do
user =
insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_business_plan_id))
user = insert(:user, subscription: build(:business_subscription))
assert :ok == unquote(mod).check_availability(user)
end
test "#{mod}.check_availability/1 returns error when site owner is on a growth plan" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
assert {:error, :upgrade_required} == unquote(mod).check_availability(user)
end
@ -35,7 +32,7 @@ defmodule Plausible.Billing.FeatureTest do
end
test "Plausible.Billing.Feature.StatsAPI.check_availability/2 returns :ok when user is on a business plan" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_business_plan_id))
user = insert(:user, subscription: build(:business_subscription))
assert :ok == Plausible.Billing.Feature.StatsAPI.check_availability(user)
end
@ -60,7 +57,7 @@ defmodule Plausible.Billing.FeatureTest do
end
test "Plausible.Billing.Feature.StatsAPI.check_availability/2 returns error when user is on a growth plan" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
assert {:error, :upgrade_required} ==
Plausible.Billing.Feature.StatsAPI.check_availability(user)
@ -73,8 +70,8 @@ defmodule Plausible.Billing.FeatureTest do
test "Plausible.Billing.Feature.Goals.check_availability/2 always returns :ok" do
u1 = insert(:user, subscription: build(:subscription, paddle_plan_id: @v1_plan_id))
u2 = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
u3 = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_business_plan_id))
u2 = insert(:user, subscription: build(:growth_subscription))
u3 = insert(:user, subscription: build(:business_subscription))
u4 =
insert(:user,
@ -113,7 +110,7 @@ defmodule Plausible.Billing.FeatureTest do
end
test "#{mod}.toggle/2 errors when site owner does not have access to the feature" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
site = insert(:site, [{:members, [user]}, {unquote(property), false}])
{:error, :upgrade_required} = unquote(mod).toggle(site)
refute unquote(mod).enabled?(site)
@ -134,7 +131,7 @@ defmodule Plausible.Billing.FeatureTest do
for mod <- [Plausible.Billing.Feature.Funnels, Plausible.Billing.Feature.Props] do
test "#{mod}.enabled?/1 returns false when user does not have access to the feature even when enabled" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
site = insert(:site, [{:members, [user]}, {unquote(mod).toggle_field(), true}])
refute unquote(mod).enabled?(site)
end

View File

@ -4,8 +4,8 @@ defmodule Plausible.Billing.PlansTest do
@v1_plan_id "558018"
@v2_plan_id "654177"
@v4_plan_id "change-me-749342"
@v4_business_plan_id "change-me-b749342"
@v4_plan_id "857097"
@v4_business_plan_id "857105"
describe "getting subscription plans for user" do
test "growth_plans_for/1 shows v1 pricing for users who are already on v1 pricing" do
@ -177,22 +177,22 @@ defmodule Plausible.Billing.PlansTest do
"749355",
"749357",
"749359",
"change-me-749343",
"change-me-749345",
"change-me-749347",
"change-me-749349",
"change-me-749352",
"change-me-749355",
"change-me-749357",
"change-me-749359",
"change-me-b749343",
"change-me-b749345",
"change-me-b749347",
"change-me-b749349",
"change-me-b749352",
"change-me-b749355",
"change-me-b749357",
"change-me-b749359"
"857079",
"857080",
"857081",
"857082",
"857083",
"857084",
"857085",
"857086",
"857087",
"857088",
"857089",
"857090",
"857091",
"857092",
"857093",
"857094"
] == Plans.yearly_product_ids()
end
end

View File

@ -6,8 +6,6 @@ defmodule Plausible.Billing.QuotaTest do
@v1_plan_id "558018"
@v2_plan_id "654177"
@v3_plan_id "749342"
@v4_growth_plan_id "change-me-749342"
@v4_business_plan_id "change-me-b749342"
describe "site_limit/1" do
test "returns 50 when user is on an old plan" do
@ -354,11 +352,9 @@ defmodule Plausible.Billing.QuotaTest do
end
test "reads from json file when the user is on a v4 plan" do
user_on_growth =
insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user_on_growth = insert(:user, subscription: build(:growth_subscription))
user_on_business =
insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_business_plan_id))
user_on_business = insert(:user, subscription: build(:business_subscription))
assert 5 == Quota.team_member_limit(user_on_growth)
assert 50 == Quota.team_member_limit(user_on_business)

View File

@ -2,8 +2,6 @@ defmodule Plausible.GoalsTest do
use Plausible.DataCase
alias Plausible.Goals
@v4_growth_plan_id "change-me-749342"
test "create/2 creates goals and trims input" do
site = insert(:site)
{:ok, goal} = Goals.create(site, %{"page_path" => "/foo bar "})
@ -73,7 +71,7 @@ defmodule Plausible.GoalsTest do
end
test "create/2 returns error when site does not have access to revenue goals" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
site = insert(:site, members: [user])
{:error, :upgrade_required} =

View File

@ -1,10 +1,8 @@
defmodule Plausible.PropsTest do
use Plausible.DataCase
@v4_growth_plan_id "change-me-749342"
test "allow/2 returns error when user plan does not include props" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
site = insert(:site, members: [user])
assert {:error, :upgrade_required} = Plausible.Props.allow(site, "my-prop-1")
@ -94,7 +92,7 @@ defmodule Plausible.PropsTest do
end
test "allow_existing_props/2 returns error when user plan does not include props" do
user = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
user = insert(:user, subscription: build(:growth_subscription))
site = insert(:site, members: [user])
populate_stats(site, [

View File

@ -1,8 +1,6 @@
defmodule Plausible.Stats.QueryTest do
use Plausible.DataCase, async: true
alias Plausible.Stats.Query
@v4_growth_plan_id "change-me-749342"
@v4_business_plan_id "change-me-b749342"
setup do
user = insert(:user)
@ -186,7 +184,7 @@ defmodule Plausible.Stats.QueryTest do
end
test "allows prop filters when site owner is on a business plan", %{site: site, user: user} do
insert(:subscription, user: user, paddle_plan_id: @v4_business_plan_id)
insert(:business_subscription, user: user)
filters = Jason.encode!(%{"props" => %{"author" => "!John Doe"}})
query = Query.from(site, %{"period" => "6mo", "filters" => filters})
@ -194,7 +192,7 @@ defmodule Plausible.Stats.QueryTest do
end
test "drops prop filter when site owner is on a growth plan", %{site: site, user: user} do
insert(:subscription, user: user, paddle_plan_id: @v4_growth_plan_id)
insert(:growth_subscription, user: user)
filters = Jason.encode!(%{"props" => %{"author" => "!John Doe"}})
query = Query.from(site, %{"period" => "6mo", "filters" => filters})

View File

@ -3,9 +3,6 @@ defmodule PlausibleWeb.Components.BillingTest do
import Phoenix.LiveViewTest
alias PlausibleWeb.Components.Billing
@v4_growth_plan_id "change-me-749342"
@v4_business_plan_id "change-me-b749342"
test "premium_feature_notice/1 renders a message when user is on trial" do
me = insert(:user)
@ -18,7 +15,7 @@ defmodule PlausibleWeb.Components.BillingTest do
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
me = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
me = insert(:user, subscription: build(:growth_subscription))
rendered =
render_component(&Billing.premium_feature_notice/1,
@ -34,7 +31,7 @@ defmodule PlausibleWeb.Components.BillingTest do
test "premium_feature_notice/1 does not render an upgrade link when user is not the site owner" do
me = insert(:user)
owner = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_growth_plan_id))
owner = insert(:user, subscription: build(:growth_subscription))
rendered =
render_component(&Billing.premium_feature_notice/1,
@ -50,7 +47,7 @@ defmodule PlausibleWeb.Components.BillingTest do
end
test "premium_feature_notice/1 does not render a notice when the user has access to the feature" do
me = insert(:user, subscription: build(:subscription, paddle_plan_id: @v4_business_plan_id))
me = insert(:user, subscription: build(:business_subscription))
rendered =
render_component(&Billing.premium_feature_notice/1,

View File

@ -1,6 +1,5 @@
defmodule PlausibleWeb.Api.ExternalStatsController.AuthTest do
use PlausibleWeb.ConnCase
@v4_growth_plan_id "change-me-749342"
setup [:create_user, :create_api_key]
@ -155,7 +154,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.AuthTest do
user: user,
api_key: api_key
} do
insert(:subscription, user: user, paddle_plan_id: @v4_growth_plan_id)
insert(:growth_subscription, user: user)
site = insert(:site, members: [user])
conn

View File

@ -1,6 +1,5 @@
defmodule PlausibleWeb.Api.StatsController.CustomPropBreakdownTest do
use PlausibleWeb.ConnCase
@v4_growth_plan_id "change-me-749342"
describe "GET /api/stats/:domain/custom-prop-values/:prop_key" do
setup [:create_user, :log_in, :create_new_site, :add_imported_data]
@ -180,7 +179,7 @@ defmodule PlausibleWeb.Api.StatsController.CustomPropBreakdownTest do
end
test "errors when site owner is on a growth plan", %{conn: conn, site: site, user: user} do
insert(:subscription, user: user, paddle_plan_id: @v4_growth_plan_id)
insert(:growth_subscription, user: user)
conn = get(conn, "/api/stats/#{site.domain}/custom-prop-values/prop?period=day")

View File

@ -3,7 +3,6 @@ defmodule PlausibleWeb.Api.StatsController.FunnelsTest do
@user_id 123
@other_user_id 456
@v4_growth_plan_id "change-me-749342"
@build_funnel_with [
{"page_path", "/blog/announcement"},
@ -226,7 +225,7 @@ defmodule PlausibleWeb.Api.StatsController.FunnelsTest do
user: user,
site: site
} do
insert(:subscription, user: user, paddle_plan_id: @v4_growth_plan_id)
insert(:growth_subscription, user: user)
{:ok, funnel} = setup_funnel(site, @build_funnel_with)
resp =

View File

@ -1,7 +1,6 @@
defmodule PlausibleWeb.Api.StatsController.TopStatsTest do
use PlausibleWeb.ConnCase
@v4_growth_plan_id "change-me-749342"
@user_id 123
describe "GET /api/stats/top-stats - default" do
@ -829,7 +828,7 @@ defmodule PlausibleWeb.Api.StatsController.TopStatsTest do
test "does not return average and total when site owner is on a growth plan",
%{conn: conn, site: site, user: user} do
insert(:subscription, user: user, paddle_plan_id: @v4_growth_plan_id)
insert(:growth_subscription, user: user)
insert(:goal, site: site, event_name: "Payment", currency: "USD")
populate_stats(site, [

View File

@ -2,7 +2,6 @@ defmodule PlausibleWeb.StatsControllerTest do
use PlausibleWeb.ConnCase, async: false
use Plausible.Repo
import Plausible.Test.Support.HTML
@v4_growth_plan_id "change-me-749342"
describe "GET /:website - anonymous user" do
test "public site - shows site stats", %{conn: conn} do
@ -160,7 +159,7 @@ defmodule PlausibleWeb.StatsControllerTest do
site: site,
user: user
} do
insert(:subscription, user: user, paddle_plan_id: @v4_growth_plan_id)
insert(:growth_subscription, user: user)
response = conn |> get("/" <> site.domain <> "/export") |> response(200)
{:ok, zip} = :zip.unzip(response, [:memory])

View File

@ -6,8 +6,8 @@ defmodule PlausibleWeb.Live.ChoosePlanTest do
alias Plausible.{Repo, Billing.Subscription}
@v1_10k_yearly_plan_id "572810"
@v4_growth_200k_yearly_plan_id "change-me-749347"
@v4_business_5m_monthly_plan_id "change-me-b749356"
@v4_growth_200k_yearly_plan_id "857081"
@v4_business_5m_monthly_plan_id "857111"
@monthly_interval_button ~s/label[phx-click="set_interval"][phx-value-interval="monthly"]/
@yearly_interval_button ~s/label[phx-click="set_interval"][phx-value-interval="yearly"]/

View File

@ -107,6 +107,14 @@ defmodule Plausible.Factory do
}
end
def growth_subscription_factory do
build(:subscription, paddle_plan_id: "857097")
end
def business_subscription_factory do
build(:subscription, paddle_plan_id: "857087")
end
def enterprise_plan_factory do
%Plausible.Billing.EnterprisePlan{
paddle_plan_id: sequence(:paddle_plan_id, &"plan-#{&1}"),