+
diff --git a/tests/Elastic.Authoring.Tests/.snapshots/DesignSystem/AppliesToComponent/RendersHtml.verified.html b/tests/Elastic.Authoring.Tests/.snapshots/DesignSystem/AppliesToComponent/RendersHtml.verified.html
new file mode 100644
index 0000000000..5879760ff9
--- /dev/null
+++ b/tests/Elastic.Authoring.Tests/.snapshots/DesignSystem/AppliesToComponent/RendersHtml.verified.html
@@ -0,0 +1,65 @@
+
+
+
+ Note
+
+
+
+
+ The
+ Elastic Stack
+ includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.
+ Availability
+
+
+ Planned
+ We plan to add this functionality in a future Elastic Stack update. Subject to changes.
+
+
+ Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.
+ This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the
+ release notes
+ for changes.
+
+
+
+
+
+
This applies to the stack.
+
+
+
Inline badge:
+
+
+
+
+ The
+ Elastic Stack
+ includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.
+ Availability
+
+
+ Planned
+ We plan to add this functionality in a future Elastic Stack update. Subject to changes.
+
+
+ Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.
+ This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the
+ release notes
+ for changes.
+
+
+
+
diff --git a/tests/Elastic.Authoring.Tests/.snapshots/DesignSystem/VectorSizingComponent/RendersHtml.verified.html b/tests/Elastic.Authoring.Tests/.snapshots/DesignSystem/VectorSizingComponent/RendersHtml.verified.html
new file mode 100644
index 0000000000..896c599718
--- /dev/null
+++ b/tests/Elastic.Authoring.Tests/.snapshots/DesignSystem/VectorSizingComponent/RendersHtml.verified.html
@@ -0,0 +1,141 @@
+
+
+
Vectors
+
+
+
+
+
The total number of vectors you plan to store in this index, not the number of documents. A single document can produce several vectors, such as one embedding for each product image and one for the description.
+
+
+
+
+
+
The number of values in each vector, set by your embedding model.
+
+
+ Advanced settings
+
+
+
+
+
+
+
+
The numeric format used to store each value in a vector. Use float32 in most cases, since Elasticsearch quantizes float vectors by default to reduce memory.
+
+
+
+
+
+
+
+
How vectors are indexed, which drives memory use and search speed. HNSW keeps a graph in memory for fast approximate search. Flat compares every vector for exact results, best at small scale. DiskBBQ reads compressed clusters from disk and needs far less memory than HNSW.
+
+
+
+
+
+
+
+
+
The percentage of clustered vector data, called posting lists, held in off-heap RAM. Supported values are 0 to 10 percent. Lower values save memory. Higher values raise query throughput and lower latency. This estimate assumes all centroids stay in RAM, since performance drops sharply otherwise.
+
+
+
+
+
+
+
+
How many neighbors each node connects to in the HNSW graph. Higher values improve recall, but increase memory and build time.
+
+
+
+
+
The target number of vectors per cluster. Smaller values create more centroids in RAM and usually improve recall at the cost of performance. The default is 384.
+
+
+
+
+
+
+
+
+
Compresses vectors to reduce memory, at some cost to accuracy. Applies to float and bfloat16 vectors only. Available options depend on your index structure.
+
+
+
+
+
The number of replica copies, not counting the primary. Each replica holds a full copy of the vector data, so replicas multiply storage and memory. The default is 0.
These estimates are disk and RAM per copy for self-managed Elasticsearch and Elastic Cloud Hosted. This RAM is for fast search, not the Java heap, and is not a full node size. Actual needs still depend on data shape, indexing settings, and query patterns.
+
+
+
diff --git a/tests/Elastic.Authoring.Tests/Applicability/AppliesToDirective.cs b/tests/Elastic.Authoring.Tests/Applicability/AppliesToDirective.cs
index 920deba723..9ac2c6d69d 100644
--- a/tests/Elastic.Authoring.Tests/Applicability/AppliesToDirective.cs
+++ b/tests/Elastic.Authoring.Tests/Applicability/AppliesToDirective.cs
@@ -79,11 +79,9 @@ public class WarnsOnOldSyntax : MarkdownTest
```
""";
- [Test, DisplayName("has no errors")]
- public async Task HasNoErrors() => await Docs.HasNoErrors();
-
- [Test, DisplayName("warns on bad syntax")]
- public async Task WarnsOnBadSyntax() => await Docs.HasWarning("Applies block does not use valid yaml keys: :hosted");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("warning {repo}/docs/index.md:2 Applies block does not use valid yaml keys: :hosted");
}
public class HintsOnInvalidKeys : MarkdownTest
@@ -94,6 +92,9 @@ public class HintsOnInvalidKeys : MarkdownTest
```
""";
- [Test, DisplayName("hints on unknown key")]
- public async Task HintsOnUnknownKey() => await Docs.HasHint("Unknown key 'hosted' in applies_to.");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "hint {repo}/docs/index.md:2 Unknown key 'hosted' in applies_to. Valid keys: apm_agent_dotnet, deployment, ecctl, ece, ech, eck, elasticsearch, elasticsearch, ess, observability, product, security, …."
+ );
}
diff --git a/tests/Elastic.Authoring.Tests/Applicability/AppliesToFrontMatter.cs b/tests/Elastic.Authoring.Tests/Applicability/AppliesToFrontMatter.cs
index cf56c75527..805f9e8947 100644
--- a/tests/Elastic.Authoring.Tests/Applicability/AppliesToFrontMatter.cs
+++ b/tests/Elastic.Authoring.Tests/Applicability/AppliesToFrontMatter.cs
@@ -304,8 +304,11 @@ public class BothEssAndEchDefinedUsesEchValueAndWarns : AuthoringTest
public async Task EchValueWins() =>
await Docs.AppliesTo(new ApplicableTo { Deployment = new DeploymentApplicability { Ess = Applies("beta") } });
- [Test, DisplayName("emits warning about both being defined")]
- public async Task EmitsWarning() => await Docs.HasWarning("Both 'ess' and 'ech' are defined");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "warning {repo}/docs/index.md Both 'ess' and 'ech' are defined. Move 'ess' content into 'ech' to avoid information loss."
+ );
}
public class ParsesEchAtTopLevel : AuthoringTest
@@ -333,8 +336,9 @@ public class ParsesProductComingDeprecated : AuthoringTest
product: coming 9.5
""");
- [Test, DisplayName("should warn of deprecated lifecycle state")]
- public async Task WarnOfDeprecatedLifecycle() => await Docs.HasHint("The 'coming' lifecycle is deprecated and will be removed");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("hint {repo}/docs/index.md The 'coming' lifecycle is deprecated and will be removed in a future release.");
}
public class ParsesProductPlanned : AuthoringTest
@@ -345,8 +349,11 @@ public class ParsesProductPlanned : AuthoringTest
product: planned 9.5
""");
- [Test, DisplayName("should warn of deprecated lifecycle state")]
- public async Task WarnOfDeprecatedLifecycle() => await Docs.HasHint("The 'planned' lifecycle is deprecated and will be removed");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "hint {repo}/docs/index.md The 'planned' lifecycle is deprecated and will be removed in a future release."
+ );
}
public class ParsesProductRemoved : AuthoringTest
@@ -600,8 +607,11 @@ public class ServerlessStringWithVersionEmitsError : AuthoringTest
serverless: ga 9.5
""");
- [Test, DisplayName("emits error for versioned serverless")]
- public async Task EmitsErrorForVersionedServerless() => await Docs.HasError("Can't specify a version for 'serverless'");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md Can't specify a version for 'serverless' because this product is not versioned. Remove the version, or use 'stack:' for version-specific requirements."
+ );
}
public class ServerlessProjectWithVersionEmitsError : AuthoringTest
@@ -613,8 +623,11 @@ public class ServerlessProjectWithVersionEmitsError : AuthoringTest
elasticsearch: ga 9.5
""");
- [Test, DisplayName("emits error for versioned elasticsearch project")]
- public async Task EmitsError() => await Docs.HasError("Can't specify a version for 'elasticsearch'");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md Can't specify a version for 'elasticsearch' because this product is not versioned. Remove the version, or use 'stack:' for version-specific requirements."
+ );
}
public class ServerlessVectorDatabaseWithVersionEmitsError : AuthoringTest
@@ -626,8 +639,11 @@ public class ServerlessVectorDatabaseWithVersionEmitsError : AuthoringTest
vectordb: ga 9.5
""");
- [Test, DisplayName("emits error for versioned vector database project")]
- public async Task EmitsError() => await Docs.HasError("Can't specify a version for 'vectordb'");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md Can't specify a version for 'vectordb' because this product is not versioned. Remove the version, or use 'stack:' for version-specific requirements."
+ );
}
public class DeploymentEssWithVersionEmitsError : AuthoringTest
@@ -639,8 +655,11 @@ public class DeploymentEssWithVersionEmitsError : AuthoringTest
ess: ga 9.5
""");
- [Test, DisplayName("emits error for versioned ess")]
- public async Task EmitsError() => await Docs.HasError("Can't specify a version for 'ess'");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md Can't specify a version for 'ess' because this product is not versioned. Remove the version, or use 'stack:' for version-specific requirements."
+ );
}
public class DeploymentEchWithVersionEmitsError : AuthoringTest
@@ -652,8 +671,11 @@ public class DeploymentEchWithVersionEmitsError : AuthoringTest
ech: preview 9.5
""");
- [Test, DisplayName("emits error for versioned ech")]
- public async Task EmitsError() => await Docs.HasError("Can't specify a version for 'ech'");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md Can't specify a version for 'ech' because this product is not versioned. Remove the version, or use 'stack:' for version-specific requirements."
+ );
}
public class TopLevelEchWithVersionEmitsError : AuthoringTest
@@ -665,8 +687,11 @@ public class TopLevelEchWithVersionEmitsError : AuthoringTest
stack: ga 9.1
""");
- [Test, DisplayName("emits error for versioned top level ech")]
- public async Task EmitsError() => await Docs.HasError("Can't specify a version for 'ech'");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md Can't specify a version for 'ech' because this product is not versioned. Remove the version, or use 'stack:' for version-specific requirements."
+ );
}
public class DeploymentStringShorthandWithVersionEmitsErrorForEss : AuthoringTest
@@ -677,6 +702,9 @@ public class DeploymentStringShorthandWithVersionEmitsErrorForEss : AuthoringTes
deployment: ga 9.0.0
""");
- [Test, DisplayName("emits error because ess does not support versions")]
- public async Task EmitsError() => await Docs.HasError("Can't specify a version for 'ess'");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md Can't specify a version for 'ess' because this product is not versioned. Remove the version, or use 'stack:' for version-specific requirements."
+ );
}
diff --git a/tests/Elastic.Authoring.Tests/Blocks/AgentSkill.cs b/tests/Elastic.Authoring.Tests/Blocks/AgentSkill.cs
index c14885aafc..faafd1b9f2 100644
--- a/tests/Elastic.Authoring.Tests/Blocks/AgentSkill.cs
+++ b/tests/Elastic.Authoring.Tests/Blocks/AgentSkill.cs
@@ -94,8 +94,9 @@ public class AgentSkillMissingUrl : MarkdownTest
:::
""";
- [Test, DisplayName("has error")]
- public async Task HasError() => await Docs.HasError("requires a :url: property");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("error {repo}/docs/index.md:2 agent-skill directive requires a :url: property");
}
public class AgentSkillRelativeUrl : MarkdownTest
@@ -106,6 +107,7 @@ public class AgentSkillRelativeUrl : MarkdownTest
:::
""";
- [Test, DisplayName("has error")]
- public async Task HasError() => await Docs.HasError("must be an absolute URL");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("error {repo}/docs/index.md:2 agent-skill :url: must be an absolute URL, got '/relative/path'");
}
diff --git a/tests/Elastic.Authoring.Tests/Blocks/CodeBlocks/CodeBlocks.cs b/tests/Elastic.Authoring.Tests/Blocks/CodeBlocks/CodeBlocks.cs
index a2eddd09c3..8be573925b 100644
--- a/tests/Elastic.Authoring.Tests/Blocks/CodeBlocks/CodeBlocks.cs
+++ b/tests/Elastic.Authoring.Tests/Blocks/CodeBlocks/CodeBlocks.cs
@@ -14,8 +14,9 @@ public class WarnsOnInvalidLanguage : MarkdownTest
```
""";
- [Test, DisplayName("validate HTML: generates link and alt attr")]
- public async Task ValidateHtml() => await Docs.HasWarning("Unknown language: not-a-valid-language");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("warning {repo}/docs/index.md:2 Unknown language: not-a-valid-language");
[Test, DisplayName("parses to EnhancedCodeBlock")]
public async Task ParsesCodeBlock()
diff --git a/tests/Elastic.Authoring.Tests/Blocks/Hub/CardsAndExplore.cs b/tests/Elastic.Authoring.Tests/Blocks/Hub/CardsAndExplore.cs
index 2715b077e9..cb5eed257c 100644
--- a/tests/Elastic.Authoring.Tests/Blocks/Hub/CardsAndExplore.cs
+++ b/tests/Elastic.Authoring.Tests/Blocks/Hub/CardsAndExplore.cs
@@ -28,21 +28,32 @@ public class CardGroupStandalone : MarkdownTest
::::
""";
- [Test, DisplayName("renders a heading and a grid, not an accordion")]
- public async Task RendersHeadingAndGrid() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
"""
);
- [Test, DisplayName("renders the card with its description")]
- public async Task RendersCardDescription() =>
- await Docs.ConvertsToContainingHtml("""
Author a page and preview it.
""");
-
[Test, DisplayName("has no errors")]
public async Task HasNoErrors() => await Docs.HasNoErrors();
}
@@ -62,8 +73,28 @@ public class CardGroupWithLinksInTheIntro : MarkdownTest
::::
""";
- [Test, DisplayName("renders inline links in the intro")]
- public async Task RendersInlineLinksInTheIntro() => await Docs.ConvertsToContainingRawHtml("""solutions""");
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
+ """
+
+ """
+ );
[Test, DisplayName("has no errors")]
public async Task HasNoErrors() => await Docs.HasNoErrors();
@@ -127,8 +193,27 @@ public class CardGroupWithLinkSyntaxInCodeInTheIntro : MarkdownTest
::::
""";
- [Test, DisplayName("keeps the code span as written")]
- public async Task KeepsCodeSpan() => await Docs.ConvertsToContainingRawHtml("[guide](/does-not-exist.md)");
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
+ """
+
+
Deploy
+
Write links as
+ [guide](/does-not-exist.md)
+ in your text.
+
+
+
+
+
+ Serverless
+
+
+
+
+ """
+ );
[Test, DisplayName("does not report a link inside code")]
public async Task HasNoErrors() => await Docs.HasNoErrors();
@@ -148,8 +233,11 @@ public class CardGroupWithABrokenLinkInTheIntro : MarkdownTest
::::
""";
- [Test, DisplayName("reports a link to a page that does not exist")]
- public async Task ReportsMissingPage() => await Docs.HasError("does-not-exist");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md:2 Directive link `/does-not-exist.md` does not exist. If it was recently removed add a redirect."
+ );
}
public class CardGroupWithSolutionsVariant : MarkdownTest
@@ -166,10 +254,13 @@ public class CardGroupWithSolutionsVariant : MarkdownTest
::::
""";
- [Test, DisplayName("locks the three column grid")]
- public async Task LocksThreeColumnGrid() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
+
+
Browse by area
+
@@ -220,74 +311,12 @@ public class CardGroupNestedInExplore : MarkdownTest
:::::
""";
- [Test, DisplayName("renders the explore heading")]
- public async Task RendersExploreHeading() =>
- await Docs.ConvertsToContainingHtml(
- """
-
-
Explore the docs
-
Organized by task.
-
- """
- );
-
- // One snapshot covers what nesting changes: accordion mode, the first accordion open and
+ // The snapshot covers what nesting changes: accordion mode, the first accordion open and
// the rest closed, and link cards as columns. It also pins the heading levels, so an
- // Explore stack keeps a complete outline: section h2, accordion h3, column h4.
- [Test, DisplayName("renders the accordion stack")]
- public async Task RendersAccordionStack() =>
- await Docs.ConvertsToContainingHtml(
- """
-
- """
- );
-
- // A column is a pure link index, so the description is deliberately dropped.
- [Test, DisplayName("drops the description in column mode")]
- public async Task DropsDescriptionInColumnMode() =>
- await Docs.DoesNotConvertToContainingHtml("This description is dropped in column mode.");
+ // Explore stack keeps a complete outline: section h2, accordion h3, column h4. A column is a
+ // pure link index, so the description is deliberately dropped.
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() => await Docs.ConvertsToHtmlSnapshot();
[Test, DisplayName("has no errors")]
public async Task HasNoErrors() => await Docs.HasNoErrors();
@@ -322,10 +351,13 @@ public class ExploreCollapsedByDefault : MarkdownTest
""";
// Without `:mode:`, every accordion starts closed, so neither `` carries `open`.
- [Test, DisplayName("renders every accordion collapsed")]
- public async Task RendersEveryAccordionCollapsed() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
+
+
Explore the docs
+
@@ -400,10 +432,13 @@ public class ExploreWithExpandedMode : MarkdownTest
:::::
""";
- [Test, DisplayName("opens every accordion")]
- public async Task OpensEveryAccordion() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
+
+
Explore the docs
+
@@ -478,10 +513,13 @@ public class ExploreWithFirstMode : MarkdownTest
:::::
""";
- [Test, DisplayName("opens only the first accordion")]
- public async Task OpensOnlyFirstAccordion() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
+
+
Explore the docs
+
@@ -556,11 +594,59 @@ public class ExploreWithInvalidMode : MarkdownTest
:::::
""";
- [Test, DisplayName("warns about the unknown mode")]
- public async Task WarnsAboutUnknownMode() => await Docs.HasWarning("Invalid {explore} mode 'sideways'");
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
+ """
+
+
Explore the docs
+
+
+
+
+
Quick links
+
+
+
+
+
+
+ Releases
+
+
+
+
+
+
+
+
Authoring
+
+
+
+
+
+
+ Syntax
+
+
+
+
+
+
+ """
+ );
- [Test, DisplayName("falls back to collapsed")]
- public async Task FallsBackToCollapsed() => await Docs.DoesNotConvertToContainingHtml(" open=\"\"");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "warning {repo}/docs/index.md:2 Invalid {explore} mode 'sideways'. Valid modes are: collapsed, first, expanded. Defaulting to 'collapsed'."
+ );
}
public class LinkCardWithoutATitle : MarkdownTest
@@ -571,8 +657,9 @@ public class LinkCardWithoutATitle : MarkdownTest
:::
""";
- [Test, DisplayName("errors")]
- public async Task Errors() => await Docs.HasError("requires a `title`");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("error {repo}/docs/index.md:2 {link-card} requires a `title` field in its YAML body.");
}
public class LinkCardWithARelativeLink : MarkdownTest
@@ -587,8 +674,11 @@ public class LinkCardWithARelativeLink : MarkdownTest
:::
""";
- [Test, DisplayName("rejects a relative path")]
- public async Task RejectsRelativePath() => await Docs.HasError("must be an absolute path starting with `/`");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md:2 Directive link `nope.md` must be an absolute path starting with `/`, a cross-link scheme (for example `kibana://`), or an external URL."
+ );
}
public class LinkCardWithAMissingTarget : MarkdownTest
@@ -603,8 +693,11 @@ public class LinkCardWithAMissingTarget : MarkdownTest
:::
""";
- [Test, DisplayName("errors on a link that does not resolve")]
- public async Task ErrorsOnMissingTarget() => await Docs.HasError("does not exist");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics(
+ "error {repo}/docs/index.md:2 Directive link `/does-not-exist.md` does not exist. If it was recently removed add a redirect."
+ );
}
public class LinkCardWithACrossLink : MarkdownTest
@@ -628,10 +721,13 @@ public class LinkCardWithACrossLink : MarkdownTest
// Covers three things at once: the icon and variant accent, and that a cross-link resolves
// to a full URL without being treated as external. Inline links make the same distinction.
- [Test, DisplayName("renders the icon and variant, and does not open the cross-link in a new tab")]
- public async Task RendersIconAndVariantWithoutNewTab() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
+
+
Documentation this toolchain builds
+
@@ -684,20 +780,13 @@ public class ExploreAtLevelThree : MarkdownTest
:::::
""";
- [Test, DisplayName("renders the section as a nested h3")]
- public async Task RendersNestedHeading() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
Use Kibana
- """
- );
-
- [Test, DisplayName("renders the accordion as h4 and the column as h5")]
- public async Task RendersNestedOutline() =>
- await Docs.ConvertsToContainingHtml(
- """
@@ -745,18 +834,39 @@ public class ExploreWithInvalidLevel : MarkdownTest
:::::
""";
- [Test, DisplayName("warns")]
- public async Task Warns() => await Docs.HasWarning("Invalid {explore} level '4'");
-
- [Test, DisplayName("falls back to h2")]
- public async Task FallsBackToH2() =>
- await Docs.ConvertsToContainingHtml(
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
"""
Explore the docs
+
+
+
+
Quick links
+
+
+
+
+
+
+ Releases
+
+
+
+
+
+
"""
);
+
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("warning {repo}/docs/index.md:2 Invalid {explore} level '4'. Valid levels are: 2, 3. Defaulting to 2.");
}
// A body that is only a YAML comment is not null, so it reaches the deserializer rather than the
@@ -770,6 +880,7 @@ public class LinkCardWithACommentOnlyBody : MarkdownTest
:::
""";
- [Test, DisplayName("errors on the missing title instead of throwing")]
- public async Task ErrorsOnMissingTitle() => await Docs.HasError("requires a `title` field");
+ [Test, DisplayName("reports diagnostics")]
+ public async Task ReportsDiagnostics() =>
+ await Docs.HasDiagnostics("error {repo}/docs/index.md:2 {link-card} requires a `title` field in its YAML body.");
}
diff --git a/tests/Elastic.Authoring.Tests/Blocks/Hub/GetStarted.cs b/tests/Elastic.Authoring.Tests/Blocks/Hub/GetStarted.cs
index d0ccf282e0..98663d6529 100644
--- a/tests/Elastic.Authoring.Tests/Blocks/Hub/GetStarted.cs
+++ b/tests/Elastic.Authoring.Tests/Blocks/Hub/GetStarted.cs
@@ -17,17 +17,30 @@ public class GetStartedWithATitleAndIntro : MarkdownTest
:::
""";
- [Test, DisplayName("renders the heading")]
- public async Task RendersHeading() =>
- await Docs.ConvertsToContainingHtml("""
Get started in 3 steps
""");
-
- [Test, DisplayName("numbers steps from one")]
- public async Task NumbersStepsFromOne() =>
- await Docs.ConvertsToContainingRawHtml("""1""");
-
// Nothing renders between the intro and the numbered list. The section is the steps.
- [Test, DisplayName("renders nothing above the steps")]
- public async Task RendersNothingAboveSteps() => await Docs.DoesNotConvertToContainingHtml("hub-get-started-actions");
+ [Test, DisplayName("renders HTML")]
+ public async Task RendersHtml() =>
+ await Docs.ConvertsToHtml(
+ """
+
+
+
Get started in 3 steps
+
Install, write, preview.
+
+
+
+
+
+ 1
+
Install
+
+
Install the CLI.
+
+
+
+
+ """
+ );
[Test, DisplayName("has no errors")]
public async Task HasNoErrors() => await Docs.HasNoErrors();
@@ -47,11 +60,36 @@ public class GetStartedWithALinkStep : MarkdownTest
:::
""";
- [Test, DisplayName("renders the step link")]
- public async Task RendersStepLink() => await Docs.ConvertsToContainingRawHtml("""Start writing""");
-
- [Test, DisplayName("keeps the arrow with the last word")]
- public async Task KeepsArrowWithLastWord() => await Docs.ConvertsToContainingRawHtml("""writing