Skip to content

Commit 0fe9999

Browse files
committed
Add failing test surfacing issue when using MentionFilter and TeamMentionFilter
1 parent 4a16827 commit 0fe9999

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/html_pipeline_test.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,19 @@ def test_node_filter_instance_context_is_carried_over_in_call
194194
# - mentions are linked
195195
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)
196196
end
197+
198+
def test_mention_and_team_mention_node_filters_are_applied
199+
text = "Hey there, @billy. This one goes out to the @cool/dev team!"
200+
201+
pipeline = HTMLPipeline.new(
202+
convert_filter: HTMLPipeline::ConvertFilter::MarkdownFilter.new,
203+
node_filters: [
204+
HTMLPipeline::NodeFilter::MentionFilter.new,
205+
HTMLPipeline::NodeFilter::TeamMentionFilter.new
206+
],
207+
)
208+
result = pipeline.call(text)[:output]
209+
210+
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)
211+
end
197212
end

0 commit comments

Comments
 (0)