Skip to content

Commit fdb987c

Browse files
committed
Add test
1 parent b8c05a7 commit fdb987c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/authoring/Inline/AppliesToRole.fs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,44 @@ type ``parses multiple applies_to in one line`` () =
121121
Ece=AppliesCollection.op_Explicit "removed"
122122
)
123123
))
124+
125+
type ``render 'GA Planned' if preview exists alongside ga`` () =
126+
static let markdown = Setup.Markdown """
127+
128+
This is an inline {applies_to}`stack: preview 9.0, ga 9.1` element.
129+
"""
130+
131+
[<Fact>]
132+
let ``parses to AppliesDirective`` () =
133+
let directives = markdown |> converts "index.md" |> parses<AppliesToRole>
134+
test <@ directives.Length = 1 @>
135+
directives |> appliesToDirective (ApplicableTo(
136+
Stack=AppliesCollection.op_Explicit "preview 9.0, ga 9.1"
137+
))
138+
139+
[<Fact>]
140+
let ``validate HTML: generates link and alt attr`` () =
141+
markdown |> convertsToHtml """
142+
<p>This is an inline
143+
<span class="applies applies-inline">
144+
<span class="applicable-info">
145+
<span class="applicable-name" data-tippy-content="Part of the versioned Elastic Stack
146+
147+
Available in ECH, ECE, ECK, and self-managed deployments, unless otherwise stated">Stack</span>
148+
<span class="applicable-separator"></span>
149+
<span class="applicable-meta applicable-meta-planned" data-tippy-content="We plan to add this functionality in a future update. Plans may change without notice.">
150+
Planned
151+
</span>
152+
</span>
153+
<span class="applicable-info">
154+
<span class="applicable-name" data-tippy-content="Part of the versioned Elastic Stack
155+
156+
Available in ECH, ECE, ECK, and self-managed deployments, unless otherwise stated">Stack</span>
157+
<span class="applicable-separator"></span>
158+
<span class="applicable-meta applicable-meta-planned" data-tippy-content="We plan to add this functionality in a future update. Plans may change without notice.">
159+
GA planned
160+
</span>
161+
</span>
162+
</span>
163+
element.</p>
164+
"""

0 commit comments

Comments
 (0)