Skip to content

Commit 4bd996a

Browse files
committed
Adjust tests to better match the currently expected output
1 parent e6d710f commit 4bd996a

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/Elastic.Markdown/Myst/Components/ApplicabilityRenderer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private static string BuildCombinedTooltipText(
114114
// Order by the same logic as primary selection: available first (by version desc), then future (by version asc)
115115
var orderedApplicabilities = applicabilities
116116
.OrderByDescending(a => a.Version is null || a.Version is AllVersionsSpec ||
117-
(a.Version is VersionSpec vs && vs.Min <= versioningSystem.Current) ? 1 : 0)
117+
(a.Version is { } vs && vs.Min <= versioningSystem.Current) ? 1 : 0)
118118
.ThenByDescending(a => a.Version?.Min ?? new SemVersion(0, 0, 0))
119119
.ThenBy(a => a.Version?.Min ?? new SemVersion(0, 0, 0))
120120
.ToList();
@@ -146,7 +146,7 @@ private static string CreateApplicabilityHeading(Applicability applicability, Ap
146146
ProductLifecycle.TechnicalPreview => "Available in technical preview",
147147
ProductLifecycle.Deprecated => "Deprecated",
148148
ProductLifecycle.Removed => "Removed",
149-
ProductLifecycle.Unavailable => "Not available",
149+
ProductLifecycle.Unavailable => "Unavailable",
150150
_ => ""
151151
};
152152

tests/Elastic.Markdown.Tests/AppliesTo/ApplicableToJsonConverterSerializationTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5+
using System.Text.Encodings.Web;
56
using System.Text.Json;
67
using Elastic.Documentation;
78
using Elastic.Documentation.AppliesTo;
@@ -13,7 +14,8 @@ public class ApplicableToJsonConverterSerializationTests
1314
{
1415
private readonly JsonSerializerOptions _options = new()
1516
{
16-
WriteIndented = true
17+
WriteIndented = true,
18+
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
1719
};
1820

1921
[Fact]

tests/authoring/Applicability/ApplicableToComponent.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ stack: ga
142142
let ``renders all versions`` () =
143143
markdown |> convertsToHtml """
144144
<p class="applies applies-block">
145-
<span class="applicable-info" data-tippy-content="Available on Elastic&nbsp;Stack unless otherwise specified.
145+
<span class="applicable-info" data-tippy-content="Available since 8.0.
146146
147147
If this functionality is unavailable or behaves differently when deployed on ECH, ECE, ECK, or a self-managed installation, it will be indicated on the page.">
148148
<span class="applicable-name">Stack</span>
@@ -479,7 +479,7 @@ stack: unavailable
479479
let ``renders unavailable`` () =
480480
markdown |> convertsToHtml """
481481
<p class="applies applies-block">
482-
<span class="applicable-info" data-tippy-content="Not available on Elastic&nbsp;Stack unless otherwise specified.">
482+
<span class="applicable-info" data-tippy-content="Unavailable since 8.0.">
483483
<span class="applicable-name">Stack</span>
484484
<span class="applicable-separator"></span>
485485
<span class="applicable-meta applicable-meta-unavailable">
@@ -500,7 +500,7 @@ product: ga
500500
let ``renders product all versions`` () =
501501
markdown |> convertsToHtml """
502502
<p class="applies applies-block">
503-
<span class="applicable-info" data-tippy-content="Available on unless otherwise specified.">
503+
<span class="applicable-info" data-tippy-content="Available since 8.0.">
504504
<span class="applicable-name"></span>
505505
<span class="applicable-meta applicable-meta-ga">
506506
</span>
@@ -694,7 +694,7 @@ stack:
694694
let ``renders missing edge cases`` () =
695695
markdown |> convertsToHtml """
696696
<p class="applies applies-block">
697-
<span class="applicable-info" data-tippy-content="Available on Elastic&nbsp;Stack unless otherwise specified.
697+
<span class="applicable-info" data-tippy-content="Available since 8.0.
698698
699699
If this functionality is unavailable or behaves differently when deployed on ECH, ECE, ECK, or a self-managed installation, it will be indicated on the page.">
700700
<span class="applicable-name">Stack</span>

tests/authoring/Blocks/Admonitions.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This is a custom admonition with applies_to information.
6464
<div class="admonition-header">
6565
<span class="admonition-title">Note</span>
6666
<span class="applies applies-admonition">
67-
<span class="applicable-info" data-tippy-content="Available on Elastic&nbsp;Stack unless otherwise specified.
67+
<span class="applicable-info" data-tippy-content="Available since 8.0.
6868
6969
If this functionality is unavailable or behaves differently when deployed on ECH, ECE, ECK, or a self-managed installation, it will be indicated on the page.">
7070
<span class="applicable-name">Stack</span>
@@ -82,7 +82,7 @@ If this functionality is unavailable or behaves differently when deployed on ECH
8282
<div class="admonition-header">
8383
<span class="admonition-title">Warning</span>
8484
<span class="applies applies-admonition">
85-
<span class="applicable-info" data-tippy-content="Available on Elastic&nbsp;Cloud&nbsp;Serverless unless otherwise specified.">
85+
<span class="applicable-info" data-tippy-content="Available since 8.0.">
8686
<span class="applicable-name">Serverless</span>
8787
<span class="applicable-meta applicable-meta-ga">
8888
</span>
@@ -98,7 +98,7 @@ If this functionality is unavailable or behaves differently when deployed on ECH
9898
<div class="admonition-header">
9999
<span class="admonition-title">Tip</span>
100100
<span class="applies applies-admonition">
101-
<span class="applicable-info" data-tippy-content="Available in technical preview on Serverless&nbsp;Elasticsearch projects unless otherwise specified.
101+
<span class="applicable-info" data-tippy-content="Available in technical preview since 8.0.
102102
103103
This functionality may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.">
104104
<span class="applicable-name">Serverless Elasticsearch</span>

0 commit comments

Comments
 (0)