Skip to content

Commit

Permalink
Add failing test surfacing issue when using MentionFilter and TeamMen…
Browse files Browse the repository at this point in the history
…tionFilter
  • Loading branch information
jeremysmithco committed Aug 4, 2024
1 parent 4a16827 commit 0fe9999
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/html_pipeline_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,19 @@ def test_node_filter_instance_context_is_carried_over_in_call
# - mentions are linked
assert_equal("<p><strong>yeH</strong>! I <em>think</em> <a href=\"http://your-domain.com/gjtorikian\" class=\"user-mention\">@gjtorikian</a> is <del>great</del>!</p>", result)
end

def test_mention_and_team_mention_node_filters_are_applied
text = "Hey there, @billy. This one goes out to the @cool/dev team!"

pipeline = HTMLPipeline.new(
convert_filter: HTMLPipeline::ConvertFilter::MarkdownFilter.new,
node_filters: [
HTMLPipeline::NodeFilter::MentionFilter.new,
HTMLPipeline::NodeFilter::TeamMentionFilter.new
],
)
result = pipeline.call(text)[:output]

assert_equal("<p>Hey there, <a href=\"/billy\" class=\"user-mention\">@billy</a>. This one goes out to the <a href=\"/cool/dev\" class=\"team-mention\">@cool/dev</a> team!</p>", result)
end
end

0 comments on commit 0fe9999

Please sign in to comment.