1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 15:19:38 +02:00

Sync notifications and troubleshooting guides (#998)

* Add help articles

* Broadcast sync messages as notifications

* Lint fixes

* more lint fixes

* Remove redundant code
This commit is contained in:
Zach Gollwitzer 2024-07-18 14:39:38 -04:00 committed by GitHub
parent b200b71284
commit fa08f027c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 256 additions and 97 deletions

View file

@ -26,9 +26,15 @@ class Account::SyncTest < ActiveSupport::TestCase
@sync.run
streams = capture_turbo_stream_broadcasts [ @account.family, :notifications ]
assert_equal "completed", @sync.status
assert_equal [ "test balance sync warning", "test holding sync warning" ], @sync.warnings
assert @sync.last_ran_at
assert_equal "append", streams.first["action"]
assert_equal "remove", streams.second["action"]
assert_equal "append", streams.third["action"]
end
test "handles sync errors" do

View file

@ -0,0 +1,21 @@
require "test_helper"
class Help::ArticleTest < ActiveSupport::TestCase
include ActiveJob::TestHelper
setup do
Help::Article.stubs(:root_path).returns(Rails.root.join("test", "fixtures", "files"))
end
test "returns nil if article not found" do
assert_nil Help::Article.find("missing")
end
test "find and renders markdown article" do
article = Help::Article.find("placeholder")
assert_equal "Placeholder", article.title
assert_equal "Test help article", article.content
assert_equal "<p>Test help article</p>\n", article.html
end
end