Known issue with search.");
}
@@ -468,3 +465,255 @@ public void ChangelogDropdownTitleStripsBackticksInHtml()
Html.Should().NotContain("`ElasticAgentVersion`");
}
}
+
+public class ChangelogDropdownsDefaultFeaturesStayListTests : DirectiveTest
+{
+ public ChangelogDropdownsDefaultFeaturesStayListTests(ITestOutputHelper output) : base(
+ output,
+ """
+ :::{changelog}
+ :description-visibility: keep-descriptions
+ :::
+ """
+ ) =>
+ FileSystem.AddFile(
+ "docs/changelog/bundles/9.3.0.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ entries:
+ - title: Feature addition
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ description: FEATURE_FLAT_BODY
+ prs:
+ - "111111"
+ """
+ )
+ );
+
+ [Fact]
+ public void FeaturesStayBulletsWithoutDropdownsOption()
+ {
+ Html.Should().NotContain("");
+ Html.Should().Contain("");
+ Html.Should().Contain("Feature addition");
+ Html.Should().Contain("FEATURE_FLAT_BODY");
+ }
+}
+
+public class ChangelogDropdownsFeaturesNotEnhancementsTests : DirectiveTest
+{
+ public ChangelogDropdownsFeaturesNotEnhancementsTests(ITestOutputHelper output) : base(
+ output,
+ """
+ :::{changelog}
+ :dropdowns:
+ :description-visibility: keep-feature-descriptions
+ :::
+ """
+ ) =>
+ FileSystem.AddFile(
+ "docs/changelog/bundles/9.3.0.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ entries:
+ - title: Feature addition
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ description: FEATURE_DROPDOWN_BODY
+ prs:
+ - "111111"
+ - title: Faster existing query
+ type: enhancement
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ description: ENHANCEMENT_LIST_BODY
+ prs:
+ - "222222"
+ """
+ )
+ );
+
+ [Fact]
+ public void FeaturesRenderAsDropdowns()
+ {
+ Html.Should().Contain("");
+ Html.Should().Contain("Feature addition");
+ Html.Should().Contain("FEATURE_DROPDOWN_BODY");
+ Html.Should().NotContain("Feature addition");
+ }
+
+ [Fact]
+ public void EnhancementsStayBullets()
+ {
+ Html.Should().Contain("Faster existing query");
+ Html.Should().NotContain("ENHANCEMENT_LIST_BODY");
+ }
+}
+
+public class ChangelogDropdownsFeaturesAutoHidesDescriptionTests : DirectiveTest
+{
+ public ChangelogDropdownsFeaturesAutoHidesDescriptionTests(ITestOutputHelper output) : base(
+ output,
+ """
+ :::{changelog}
+ :dropdowns:
+ :::
+ """
+ ) =>
+ FileSystem.AddFile(
+ "docs/changelog/bundles/9.3.0.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ entries:
+ - title: Feature addition
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ description: FEATURE_AUTO_HIDDEN_BODY
+ prs:
+ - "111111"
+ """
+ )
+ );
+
+ [Fact]
+ public void RendersFeatureDropdownWithoutDescription()
+ {
+ Html.Should().Contain("");
+ Html.Should().Contain("Feature addition");
+ Html.Should().Contain("#111111");
+ Html.Should().NotContain("FEATURE_AUTO_HIDDEN_BODY");
+ }
+}
+
+public class ChangelogDropdownsWithoutSubsectionsOmitsAreaHeadersTests : DirectiveTest
+{
+ public ChangelogDropdownsWithoutSubsectionsOmitsAreaHeadersTests(ITestOutputHelper output) : base(
+ output,
+ """
+ :::{changelog}
+ :dropdowns:
+ :description-visibility: keep-feature-descriptions
+ :::
+ """
+ ) =>
+ FileSystem.AddFile(
+ "docs/changelog/bundles/9.3.0.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ entries:
+ - title: Feature in Search
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ areas:
+ - Search
+ description: Search feature body
+ prs:
+ - "111111"
+ - title: Feature in Indexing
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ areas:
+ - Indexing
+ description: Indexing feature body
+ prs:
+ - "222222"
+ """
+ )
+ );
+
+ [Fact]
+ public void RendersDropdowns() => Html.Should().Contain("");
+
+ [Fact]
+ public void OmitsAreaHeaders()
+ {
+ Html.Should().NotContain("Search");
+ Html.Should().NotContain("Indexing");
+ }
+
+ [Fact]
+ public void StillRendersFeatureTitles()
+ {
+ Html.Should().Contain("Feature in Search");
+ Html.Should().Contain("Feature in Indexing");
+ }
+}
+
+public class ChangelogDropdownsWithSubsectionsRendersAreaHeadersTests : DirectiveTest
+{
+ public ChangelogDropdownsWithSubsectionsRendersAreaHeadersTests(ITestOutputHelper output) : base(
+ output,
+ """
+ :::{changelog}
+ :dropdowns:
+ :subsections:
+ :description-visibility: keep-feature-descriptions
+ :::
+ """
+ ) =>
+ FileSystem.AddFile(
+ "docs/changelog/bundles/9.3.0.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ entries:
+ - title: Feature in Search
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ areas:
+ - Search
+ description: Search feature body
+ prs:
+ - "111111"
+ - title: Feature in Indexing
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ areas:
+ - Indexing
+ description: Indexing feature body
+ prs:
+ - "222222"
+ """
+ )
+ );
+
+ [Fact]
+ public void RendersDropdowns() => Html.Should().Contain("");
+
+ [Fact]
+ public void RendersAreaHeaders()
+ {
+ Html.Should().Contain("Search");
+ Html.Should().Contain("Indexing");
+ }
+}
diff --git a/tests/Elastic.Markdown.Tests/Directives/ChangelogFeatureEnhancementSectionTests.cs b/tests/Elastic.Markdown.Tests/Directives/ChangelogFeatureEnhancementSectionTests.cs
new file mode 100644
index 0000000000..032506289e
--- /dev/null
+++ b/tests/Elastic.Markdown.Tests/Directives/ChangelogFeatureEnhancementSectionTests.cs
@@ -0,0 +1,145 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information
+
+using System.IO.Abstractions.TestingHelpers;
+using AwesomeAssertions;
+using Elastic.Markdown.Myst.Directives.Changelog;
+
+namespace Elastic.Markdown.Tests.Directives;
+
+public class ChangelogFeatureAndEnhancementSectionsTests(ITestOutputHelper output) : DirectiveTest(
+ output,
+ """
+ :::{changelog}
+ :::
+ """
+)
+{
+ protected override void AddToFileSystem(MockFileSystem fileSystem) =>
+ fileSystem.AddFile(
+ "docs/changelog/bundles/9.3.0.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ entries:
+ - title: Brand new capability
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ - title: Improved existing capability
+ type: enhancement
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ - title: Bug fix
+ type: bug-fix
+ products:
+ - product: elasticsearch
+ target: 9.3.0
+ """
+ )
+ );
+
+ [Fact]
+ public void RendersSeparateFeaturesHeading() => Html.Should().Contain(">Features<");
+
+ [Fact]
+ public void RendersSeparateEnhancementsHeading() => Html.Should().Contain(">Enhancements<");
+
+ [Fact]
+ public void OmitsCombinedHeading() => Html.Should().NotContain("Features and enhancements");
+
+ [Fact]
+ public void FeaturesAppearBeforeEnhancements()
+ {
+ var featuresIdx = Html.IndexOf(">Features<", StringComparison.Ordinal);
+ var enhancementsIdx = Html.IndexOf(">Enhancements<", StringComparison.Ordinal);
+ featuresIdx.Should().BeLessThan(enhancementsIdx);
+ }
+
+ [Fact]
+ public void TocIncludesBothSections()
+ {
+ var toc = Block!.GeneratedTableOfContent.ToList();
+ toc.Should().Contain(t => t.Heading == "Features" && t.Slug.EndsWith("-features"));
+ toc.Should().Contain(t => t.Heading == "Enhancements" && t.Slug.EndsWith("-enhancements"));
+ }
+}
+
+public class ChangelogEnhancementsOnlyOmitsFeaturesSectionTests(ITestOutputHelper output) : DirectiveTest(
+ output,
+ """
+ :::{changelog}
+ :::
+ """
+)
+{
+ protected override void AddToFileSystem(MockFileSystem fileSystem) =>
+ fileSystem.AddFile(
+ "docs/changelog/bundles/9.3.6.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.3.6
+ entries:
+ - title: Faster existing query
+ type: enhancement
+ products:
+ - product: elasticsearch
+ target: 9.3.6
+ """
+ )
+ );
+
+ [Fact]
+ public void RendersEnhancements() => Html.Should().Contain(">Enhancements<");
+
+ [Fact]
+ public void OmitsEmptyFeaturesSection() => Html.Should().NotContain(">Features<");
+
+ [Fact]
+ public void TocOmitsFeatures()
+ {
+ var toc = Block!.GeneratedTableOfContent.ToList();
+ toc.Should().NotContain(t => t.Heading == "Features");
+ toc.Should().Contain(t => t.Heading == "Enhancements");
+ }
+}
+
+public class ChangelogFeaturesOnlyOmitsEnhancementsSectionTests(ITestOutputHelper output) : DirectiveTest(
+ output,
+ """
+ :::{changelog}
+ :::
+ """
+)
+{
+ protected override void AddToFileSystem(MockFileSystem fileSystem) =>
+ fileSystem.AddFile(
+ "docs/changelog/bundles/9.4.0.yaml",
+ new MockFileData(
+ """
+ products:
+ - product: elasticsearch
+ target: 9.4.0
+ entries:
+ - title: Entirely new API
+ type: feature
+ products:
+ - product: elasticsearch
+ target: 9.4.0
+ """
+ )
+ );
+
+ [Fact]
+ public void RendersFeatures() => Html.Should().Contain(">Features<");
+
+ [Fact]
+ public void OmitsEmptyEnhancementsSection() => Html.Should().NotContain(">Enhancements<");
+}
diff --git a/tests/Elastic.Markdown.Tests/Directives/ChangelogHideLinksTests.cs b/tests/Elastic.Markdown.Tests/Directives/ChangelogHideLinksTests.cs
index 39f7dd567d..50a9929d50 100644
--- a/tests/Elastic.Markdown.Tests/Directives/ChangelogHideLinksTests.cs
+++ b/tests/Elastic.Markdown.Tests/Directives/ChangelogHideLinksTests.cs
@@ -453,7 +453,7 @@ public void MergedBundle_TocSlug_MatchesHeadingId()
{
var section = Block!.GeneratedTableOfContent.Single(t => t.Level == 3);
- section.Slug.Should().Be("elasticsearchkibana-2025-08-05-features-enhancements");
+ section.Slug.Should().Be("elasticsearchkibana-2025-08-05-features");
Html.Should().Contain($"id=\"{section.Slug}\"");
}
diff --git a/tests/Elastic.Markdown.Tests/Directives/ChangelogHighlightsOptionTests.cs b/tests/Elastic.Markdown.Tests/Directives/ChangelogHighlightsOptionTests.cs
index c9eddb2289..ce62607bb5 100644
--- a/tests/Elastic.Markdown.Tests/Directives/ChangelogHighlightsOptionTests.cs
+++ b/tests/Elastic.Markdown.Tests/Directives/ChangelogHighlightsOptionTests.cs
@@ -78,7 +78,7 @@ public ChangelogHighlightsOptionDefaultOffTests(ITestOutputHelper output) : base
[Fact]
public void StillRendersHighlightedEntryUnderTypeSection()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Highlighted feature");
Html.Should().Contain("Regular feature");
Html.Should().Contain("Fixes");
@@ -118,7 +118,7 @@ public ChangelogHighlightsOptionEnabledTests(ITestOutputHelper output) : base(
[Fact]
public void DuplicatesHighlightedEntryInTypeSection()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Highlighted feature");
Html.Should().Contain("Regular feature");
}
@@ -157,7 +157,7 @@ public void RendersHighlightsAndSeparatedTypes()
{
Html.Should().Contain("Highlights");
Html.Should().Contain("Breaking changes");
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
}
}
@@ -218,7 +218,7 @@ public void EmitsWarningPointingToHighlightsOption() =>
[Fact]
public void RendersDefaultTypeSectionsNotHighlightsOnly()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Highlighted feature");
Html.Should().NotContain("id=\"elasticsearch-9.3.0-highlights\"");
}
@@ -300,7 +300,7 @@ public void ParsesKeepHighlightDescriptions() =>
[Fact]
public void StillRendersTitlesInTypeSections()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Highlighted feature");
Html.Should().Contain("Regular feature");
}
diff --git a/tests/Elastic.Markdown.Tests/Directives/ChangelogTocFilteringTests.cs b/tests/Elastic.Markdown.Tests/Directives/ChangelogTocFilteringTests.cs
index 61fada3446..72e09876bc 100644
--- a/tests/Elastic.Markdown.Tests/Directives/ChangelogTocFilteringTests.cs
+++ b/tests/Elastic.Markdown.Tests/Directives/ChangelogTocFilteringTests.cs
@@ -94,7 +94,7 @@ public void TocIncludesOtherSection()
public void TocIncludesFeaturesSection()
{
var tocItems = Block!.GeneratedTableOfContent.ToList();
- tocItems.Should().Contain(t => t.Heading == "Features and enhancements");
+ tocItems.Should().Contain(t => t.Heading == "Features");
}
[Fact]
@@ -123,7 +123,7 @@ public void HtmlContainsAllSections()
{
Html.Should().Contain("Documentation");
Html.Should().Contain("Other changes");
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
}
}
@@ -193,7 +193,7 @@ public void TocExcludesHiddenOtherSection()
public void TocRetainsVisibleFeaturesSection()
{
var tocItems = Block!.GeneratedTableOfContent.ToList();
- tocItems.Should().Contain(t => t.Heading == "Features and enhancements");
+ tocItems.Should().Contain(t => t.Heading == "Features");
}
[Fact]
@@ -207,7 +207,7 @@ public void AnchorsExcludeHiddenOtherSection()
public void AnchorsRetainVisibleFeaturesSection()
{
var anchors = Block!.GeneratedAnchors.ToList();
- anchors.Should().Contain(a => a.Contains("features-enhancements"));
+ anchors.Should().Contain(a => a.Contains("features"));
}
[Fact]
@@ -215,7 +215,7 @@ public void HtmlMatchesTocFiltering()
{
Html.Should().NotContain("Other changes");
Html.Should().NotContain("Hidden other change");
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Visible feature");
}
}
@@ -371,7 +371,7 @@ public void TocExcludesHideFeatureFilteredSection()
public void TocRetainsUnfilteredSection()
{
var tocItems = Block!.GeneratedTableOfContent.ToList();
- tocItems.Should().Contain(t => t.Heading == "Features and enhancements");
+ tocItems.Should().Contain(t => t.Heading == "Features");
}
[Fact]
@@ -385,7 +385,7 @@ public void AnchorsExcludeOnlyHideFeatureFilteredSection()
[Fact]
public void HtmlMatchesTocAndAnchors()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Visible feature");
Html.Should().Contain("Documentation");
Html.Should().Contain("Docs entry blocked by type");
@@ -483,7 +483,7 @@ public void TocIncludesOtherSection()
public void TocIncludesFeaturesSection()
{
var tocItems = Block!.GeneratedTableOfContent.ToList();
- tocItems.Should().Contain(t => t.Heading == "Features and enhancements");
+ tocItems.Should().Contain(t => t.Heading == "Features");
}
[Fact]
@@ -492,7 +492,7 @@ public void AnchorsIncludeAllSections()
var anchors = Block!.GeneratedAnchors.ToList();
anchors.Should().Contain(a => a.Contains("-docs"));
anchors.Should().Contain(a => a.EndsWith("-other"));
- anchors.Should().Contain(a => a.Contains("features-enhancements"));
+ anchors.Should().Contain(a => a.Contains("features"));
}
}
@@ -658,7 +658,7 @@ public void BothVersionsHaveDocumentationInToc()
public void FirstVersionRetainsFeaturesInToc()
{
var tocItems = Block!.GeneratedTableOfContent.ToList();
- tocItems.Should().Contain(t => t.Heading == "Features and enhancements");
+ tocItems.Should().Contain(t => t.Heading == "Features");
}
[Fact]
diff --git a/tests/Elastic.Markdown.Tests/Directives/ChangelogTypeFilterTests.cs b/tests/Elastic.Markdown.Tests/Directives/ChangelogTypeFilterTests.cs
index 25ed1f3e81..045d798425 100644
--- a/tests/Elastic.Markdown.Tests/Directives/ChangelogTypeFilterTests.cs
+++ b/tests/Elastic.Markdown.Tests/Directives/ChangelogTypeFilterTests.cs
@@ -89,7 +89,7 @@ public ChangelogTypeFilterDefaultTests(ITestOutputHelper output) : base(
[Fact]
public void DefaultBehaviorShowsFeatures()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("New feature");
}
@@ -199,7 +199,7 @@ public ChangelogTypeFilterAllTests(ITestOutputHelper output) : base(
[Fact]
public void ShowsAllEntryTypes()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("New feature");
Html.Should().Contain(">Fixes<");
Html.Should().Contain("Bug fix");
@@ -303,7 +303,7 @@ public void ShowsBreakingChanges()
[Fact]
public void ExcludesOtherTypes()
{
- Html.Should().NotContain("Features and enhancements");
+ Html.Should().NotContain("Features");
Html.Should().NotContain("New feature");
Html.Should().NotContain("Known issues");
Html.Should().NotContain("Known issue");
@@ -379,7 +379,7 @@ public void ShowsDeprecations()
[Fact]
public void ExcludesOtherTypes()
{
- Html.Should().NotContain("Features and enhancements");
+ Html.Should().NotContain("Features");
Html.Should().NotContain("New feature");
}
}
@@ -453,7 +453,7 @@ public void ShowsKnownIssues()
[Fact]
public void ExcludesOtherTypes()
{
- Html.Should().NotContain("Features and enhancements");
+ Html.Should().NotContain("Features");
Html.Should().NotContain("New feature");
}
}
@@ -511,7 +511,7 @@ public ChangelogTypeFilterInvalidTests(ITestOutputHelper output) : base(
[Fact]
public void DefaultBehaviorIsApplied()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("New feature");
Html.Should().NotContain("Breaking changes");
}
@@ -567,7 +567,7 @@ public ChangelogTypeFilterCaseInsensitiveTests(ITestOutputHelper output) : base(
[Fact]
public void ShowsAllTypes()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Breaking changes");
}
}
@@ -638,7 +638,7 @@ public void TypeFilterAndSubsectionsBothWork()
[Fact]
public void ShowsAllTypesWithSubsections()
{
- Html.Should().Contain("Features and enhancements");
+ Html.Should().Contain("Features");
Html.Should().Contain("Search feature");
Html.Should().Contain("Indexing feature");
Html.Should().Contain("Breaking changes");
@@ -695,7 +695,7 @@ public void GeneratedAnchorsRespectTypeFilter()
var anchors = Block!.GeneratedAnchors.ToList();
anchors.Should().NotContain(a => a.Contains("breaking-changes"));
- anchors.Should().NotContain(a => a.Contains("features-enhancements"));
+ anchors.Should().NotContain(a => a.Contains("features"));
}
}
@@ -750,7 +750,7 @@ public void TableOfContentsRespectTypeFilter()
tocItems.Should().NotContain(t => t.Heading == "Deprecations");
tocItems.Should().Contain(t => t.Heading == "9.3.0" && t.Level == 2);
- tocItems.Should().NotContain(t => t.Heading == "Features and enhancements");
+ tocItems.Should().NotContain(t => t.Heading == "Features");
}
}