Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app/issues/851
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Feb 23, 2024
1 parent a9b39b9 commit 2d52689
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
2 changes: 2 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ config :needle, :search_path, [:bonfire_me]

config_file = if Mix.env() == :test, do: "config/test.exs", else: "config/config.exs"

config :bonfire, Bonfire.Common.Repo, database: "bonfire_test"

cond do
File.exists?("../bonfire/#{config_file}") ->
IO.puts("Load #{config_file} from local clone of bonfire_spark")
Expand Down
8 changes: 6 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ defmodule Bonfire.UI.Me.MixProject do
Mess.deps([
# {:phoenix_live_reload, "~> 1.2", only: :dev},
{:zest, "~> 0.1", only: :test},
{:mneme, ">= 0.0.0", only: [:dev, :test]},

{:bonfire,
git: "https://github.com/bonfire-networks/bonfire_spark",
branch: "main",
only: :test},
only: :test,
runtime: false
},

{:phoenix_test,
# "~> 0.2.4",
git: "https://github.com/germsvel/phoenix_test",
only: :test, runtime: false}

# {:bonfire_tag,
# git: "https://github.com/bonfire-networks/bonfire_tag",
# branch: "main",
Expand Down Expand Up @@ -76,6 +79,7 @@ defmodule Bonfire.UI.Me.MixProject do
updates: ["deps.get", "ecto.migrate", "js.deps.get"],
"ecto.setup": ["ecto.create", "ecto.migrate", "ecto.seeds"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["test"],
"test.with-db": ["ecto.create --quiet", "ecto.migrate --quiet", "test"]
]
end
Expand Down
7 changes: 5 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"bamboo_sparkpost": {:hex, :bamboo_sparkpost, "2.0.0", "8617642e438340186da422b7f1ec25663d1c8fa869ecaf3e5ba2524131a1b5f0", [:mix], [{:bamboo, "~> 2.0", [hex: :bamboo, repo: "hexpm", optional: false]}], "hexpm", "a89a1c29e122270e50c53c77e091d885c40bebb689f8904572c38b299649bebf"},
"bandit": {:hex, :bandit, "1.2.2", "569fe5d0efb107c9af37a1e37e25ce2ceec293101a2d4bc512876fc3207192b5", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "2f89adb7281c78d4e75733e0a9e1b24f46f84d2993963d6fa57d0eafadec5f03"},
"beam_file": {:hex, :beam_file, "0.5.3", "8ef6b6ab3b2981e5d67c20e635fdddab4b82d96d25fe50c26a259bafed996ead", [:mix], [], "hexpm", "f4722cc3b811b94c4941fa981e25319f7b2ae24495196fcf075208cffb9228e4"},
"bonfire": {:git, "https://github.com/bonfire-networks/bonfire_spark", "d9719042bbf0a37fb0dd114d57a270c676518d8c", [branch: "main"]},
"bonfire": {:git, "https://github.com/bonfire-networks/bonfire_spark", "f4d3c2b133f53be962b989c40ab925893c3c0221", [branch: "main"]},
"bonfire_boundaries": {:git, "https://github.com/bonfire-networks/bonfire_boundaries", "83f4c0fcd663188f2314ff2b9d27712f3b064ae6", [branch: "main"]},
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "bfa4dbfb3b00a580606f267e1b4c5d4deaacf57b", [branch: "main"]},
"bonfire_data_access_control": {:git, "https://github.com/bonfire-networks/bonfire_data_access_control", "b7c3cd9886a22e0b3652baa7edd079fac29bdea3", [branch: "main"]},
Expand Down Expand Up @@ -84,6 +84,7 @@
"gen_stage": {:hex, :gen_stage, "0.14.3", "d0c66f1c87faa301c1a85a809a3ee9097a4264b2edf7644bf5c123237ef732bf", [:mix], [], "hexpm", "8453e2289d94c3199396eb517d65d6715ef26bcae0ee83eb5ff7a84445458d76"},
"gettext": {:hex, :gettext, "0.24.0", "6f4d90ac5f3111673cbefc4ebee96fe5f37a114861ab8c7b7d5b30a1108ce6d8", [:mix], [{:expo, "~> 0.5.1", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "bdf75cdfcbe9e4622dd18e034b227d77dd17f0f133853a1c73b97b3d6c770e8b"},
"git_diff": {:hex, :git_diff, "0.6.4", "ec53ebf8bf83b4527d938d6433e3686b47a3e2a23135a21038f76736c16bb6e0", [:mix], [], "hexpm", "9e05563c136c91e960a306fd296156b2e8d74e294ae60961e69a36e118023a5f"},
"glob_ex": {:hex, :glob_ex, "0.1.6", "3a311ade50f6b71d638af660edcc844c3ab4eb2a2c816cfebb73a1d521bb2f9d", [:mix], [], "hexpm", "fda1e90e10f6029bd72967fef0c9891d0d14da89ca7163076e6028bfcb2c42fa"},
"gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"},
"grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"},
"hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"},
Expand Down Expand Up @@ -117,6 +118,7 @@
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"mint": {:hex, :mint, "1.5.2", "4805e059f96028948870d23d7783613b7e6b0e2fb4e98d720383852a760067fd", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "d77d9e9ce4eb35941907f1d3df38d8f750c357865353e21d335bdcdf6d892a02"},
"mneme": {:hex, :mneme, "0.5.0", "773c575fa3d7408a8970016351a8ae92f2c4457193bdf1bcf9a5f0adf06b9695", [:mix], [{:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:owl, "~> 0.8.0", [hex: :owl, repo: "hexpm", optional: false]}, {:rewrite, "~> 0.7", [hex: :rewrite, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.12", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "c25ef684985c1036560b507e3fd87d44818320ae541c6f1c017caab37d15f325"},
"mochiweb": {:hex, :mochiweb, "3.2.1", "ff287e1ec653a0828f226cd5a009d52be74537dc3fc274b765525a77ce01f8ec", [:rebar3], [], "hexpm", "975466d335403a78cd58186636b8e960e3c84c4d9c1a85eb7fe53b6a5dd54de7"},
"mogrify": {:hex, :mogrify, "0.9.3", "238c782f00271dace01369ad35ae2e9dd020feee3443b9299ea5ea6bed559841", [:mix], [], "hexpm", "0189b1e1de27455f2b9ae8cf88239cefd23d38de9276eb5add7159aea51731e6"},
"needle": {:git, "https://github.com/bonfire-networks/needle", "726cc2330180230d6a6f70a6d8d2c735e0d77bde", []},
Expand All @@ -141,7 +143,7 @@
"opentelemetry_telemetry": {:hex, :opentelemetry_telemetry, "1.0.0", "d5982a319e725fcd2305b306b65c18a86afdcf7d96821473cf0649ff88877615", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_registry, "~> 0.3.0", [hex: :telemetry_registry, repo: "hexpm", optional: false]}], "hexpm", "3401d13a1d4b7aa941a77e6b3ec074f0ae77f83b5b2206766ce630123a9291a9"},
"orion": {:hex, :orion, "1.0.4", "e99f0a34e9a90a1d841ef09e864917d73ac906c9d6d626bb12f9fa14b517b937", [:mix], [{:dog_sketch, "~> 0.1.2", [hex: :dog_sketch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:orion_collector, "~> 1.2.0", [hex: :orion_collector, repo: "hexpm", optional: false]}, {:phoenix_live_view, ">= 0.18.16 and <= 0.21.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "219c39080c5c433691923775353759c207e4fe6c71ca602f1c0d01257073b664"},
"orion_collector": {:hex, :orion_collector, "1.2.0", "9041f55532faacadcc4d6259a1eac472fdd6d9ba533ccce9801d62dd72020332", [:mix], [{:dog_sketch, "~> 0.1.2", [hex: :dog_sketch, repo: "hexpm", optional: false]}, {:ex2ms, "~> 1.6", [hex: :ex2ms, repo: "hexpm", optional: false]}], "hexpm", "f6eb4687123c5845da2bb82002babdaf87ccb8ddb3762cde304aa09f24832422"},
"owl": {:hex, :owl, "0.9.0", "9b33d64734bd51d3fc1d6ed01b12f8c2ed23e1fbf8c43658a6dfbff62578bd03", [:mix], [{:ucwidth, "~> 0.2", [hex: :ucwidth, repo: "hexpm", optional: true]}], "hexpm", "cd70b55327985f8f24d38cb7de5bf8a8d24040e1b49cca2345508f8119ce81fd"},
"owl": {:hex, :owl, "0.8.0", "0ef925cb784311093d4e3734822960cbdbdb13b095d748bb5bc82abcd5b56732", [:mix], [], "hexpm", "0a5586ceb1a12f4bbda90e330c20e6ea034552335d09466c10e4218c98977529"},
"paginator": {:git, "https://github.com/bonfire-networks/paginator", "28f4a8106fd9f7b100b42af514530a5c2503601c", [branch: "main"]},
"pane": {:hex, :pane, "0.4.1", "ca4275b5799066d52c857e7b0deb2feaba409d607419fe54cde056329d247a89", [:mix], [], "hexpm", "27a292ca86f52d4777422930c17fd4a12eaa930d86a6193665c452f94a04ff8a"},
"paper_trail": {:git, "https://github.com/bonfire-networks/paper_trail", "fb7008fd3085e20b15018fb842711c35c0d26025", [branch: "with-pointers"]},
Expand Down Expand Up @@ -171,6 +173,7 @@
"recase": {:hex, :recase, "0.7.0", "3f2f719f0886c7a3b7fe469058ec539cb7bbe0023604ae3bce920e186305e5ae", [:mix], [], "hexpm", "36f5756a9f552f4a94b54a695870e32f4e72d5fad9c25e61bc4a3151c08a4e0c"},
"remote_ip": {:hex, :remote_ip, "1.1.0", "cb308841595d15df3f9073b7c39243a1dd6ca56e5020295cb012c76fbec50f2d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "616ffdf66aaad6a72fc546dabf42eed87e2a99e97b09cbd92b10cc180d02ed74"},
"req": {:hex, :req, "0.4.11", "cb19f87d5251e7de30cfc67d1899696b290711092207c6b2e8fc2294f237fcdc", [:mix], [{:aws_signature, "~> 0.3.2", [hex: :aws_signature, repo: "hexpm", optional: true]}, {:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.17", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:nimble_ownership, "~> 0.2.0", [hex: :nimble_ownership, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "bbf4f2393c649fa4146a3b8470e2a7e8c9b23e4100a16c75f5e7d1d3d33144f3"},
"rewrite": {:hex, :rewrite, "0.10.0", "5d756b6dc67679e7156ff6055f9654be02dbaeb177aaf1ff6af7ee8da8718248", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.13", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "68d7808cf549e7bf51b0119a8edc14d50970bad479115249030baa580c1d7b50"},
"rustler_precompiled": {:hex, :rustler_precompiled, "0.7.1", "ecadf02cc59a0eccbaed6c1937303a5827fbcf60010c541595e6d3747d3d0f9f", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "b9e4657b99a1483ea31502e1d58c464bedebe9028808eda45c3a429af4550c66"},
"scribe": {:hex, :scribe, "0.10.0", "90e61b21fee884f58b955d1f45d7fa3e75f161ecb62bad8af6087aef3955c74f", [:mix], [{:pane, "~> 0.2", [hex: :pane, repo: "hexpm", optional: false]}], "hexpm", "3829da9c6a28b2105f0ec50e40f447bf768fb7d96717fbfceb602573f1a3c62e"},
"sleeplocks": {:hex, :sleeplocks, "1.1.2", "d45aa1c5513da48c888715e3381211c859af34bee9b8290490e10c90bb6ff0ca", [:rebar3], [], "hexpm", "9fe5d048c5b781d6305c1a3a0f40bb3dfc06f49bf40571f3d2d0c57eaa7f59a5"},
Expand Down
14 changes: 3 additions & 11 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
IO.puts("Prepare to run tests...")

ExUnit.start(exclude: Bonfire.Common.RuntimeConfig.skip_test_tags())
Application.ensure_all_started(:bonfire)

repo = Bonfire.Common.Config.repo()

if GenServer.whereis(repo) do
Ecto.Adapters.SQL.Sandbox.mode(
repo,
:manual
)
end

IO.puts("Running tests...")
Code.ensure_loaded!(Bonfire.Testing)
Bonfire.Testing.configure_start_test()
6 changes: 3 additions & 3 deletions test/views/settings_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Bonfire.UI.Me.SettingsTest do
use Bonfire.UI.Me.ConnCase, async: false
use Mneme
import Phoenix.LiveViewTest
import Bonfire.Files.Simulation
# alias Bonfire.Files.Simulation, as: FakeFiles

alias Bonfire.Posts
alias Bonfire.Social.Boosts
Expand All @@ -11,9 +11,9 @@ defmodule Bonfire.UI.Me.SettingsTest do
alias Bonfire.Common.Config

setup_all do
orig1 = Config.get!(:pagination_hard_max_limit)
orig1 = Config.get(:pagination_hard_max_limit)

orig2 = Config.get!(:default_pagination_limit)
orig2 = Config.get(:default_pagination_limit)

Config.put(:pagination_hard_max_limit, 10)

Expand Down

0 comments on commit 2d52689

Please sign in to comment.