Skip to content

Commit

Permalink
chore: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Dec 18, 2024
1 parent eb8061f commit b13afdc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/logflare/billing.ex
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ defmodule Logflare.Billing do
SingleTenant.single_tenant?() ->
get_plan_by(name: "Enterprise")

Partners.Cache.user_upgraded?(user) ->
Partners.user_upgraded?(user) ->
get_plan_by(name: "Enterprise")

user.billing_enabled == false ->
Expand Down
2 changes: 1 addition & 1 deletion lib/logflare/sources/source.ex
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ defmodule Logflare.Source do
days = round(plan.limit_source_ttl / :timer.hours(24))

cond do
user.bigquery_project_id ->
user.bigquery_project_id != Application.get_env(:logflare, Logflare.Google)[:project_id] ->
[]

ttl > days ->
Expand Down
10 changes: 4 additions & 6 deletions test/logflare/users/users_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ defmodule Logflare.UsersTest do
end

describe "get_by/1" do
test "get user by id", %{source: s1, user: u1} do
assert u1 == Users.get_by(id: u1.id) |> Users.preload_defaults()
assert length(u1.sources) > 0
assert s1_db = hd(u1.sources)
assert s1_db.token == s1.token
assert s1_db.user_id == u1.id
test "get user by id", %{user: u1} do
assert %User{} = fetched = Users.get_by(id: u1.id)
assert fetched.bigquery_dataset_id
assert fetched.bigquery_project_id
end

test "get user by api_key", %{user: right_user} do
Expand Down

0 comments on commit b13afdc

Please sign in to comment.