Skip to content

Commit

Permalink
Add testing dir and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorelli25 committed Dec 19, 2024
1 parent a81f363 commit 4cd1158
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 13 deletions.
1 change: 1 addition & 0 deletions docs/source/docset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ toc:
- file: tabs.md
- file: tagged_regions.md
- file: titles.md
- folder: testing
5 changes: 5 additions & 0 deletions docs/source/testing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Testing
---

The files in this directory are used for testing purposes. Do not edit these files unless you are working on tests.
14 changes: 14 additions & 0 deletions docs/source/testing/req.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Requirements"
---

To follow this tutorial you will need to install the following components:

- An installation of Elasticsearch, based on our hosted [Elastic Cloud](https://www.elastic.co/cloud) service (which includes a free trial period), or a self-hosted service that you run on your own computer. See the Install Elasticsearch section above for installation instructions.
- A [Python](https://python.org) interpreter. Make sure it is a recent version, such as Python 3.8 or newer.

The tutorial assumes that you have no previous knowledge of Elasticsearch or general search topics, but it expects you to have a basic familiarity with the following technologies, at least at a beginner level:

- Python development
- The [Flask](https://flask.palletsprojects.com/) web framework for Python.
- The command prompt or terminal application in your operating system.
9 changes: 4 additions & 5 deletions tests/Elastic.Markdown.Tests/Inline/AnchorLinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
To follow this tutorial you will need to install the following components:
""";
fileSystem.AddFile(@"docs/source/elastic/search-labs/search/req.md", inclusion);
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
}

Expand All @@ -59,7 +59,7 @@ public void GeneratesHtml() =>

public class ExternalPageAnchorTests(ITestOutputHelper output) : AnchorLinkTestBase(output,
"""
[Sub Requirements](elastic/search-labs/search/req.md#sub-requirements)
[Sub Requirements](testing/req.md#sub-requirements)
"""
)
{
Expand All @@ -76,7 +76,7 @@ public void GeneratesHtml() =>

public class ExternalPageAnchorAutoTitleTests(ITestOutputHelper output) : AnchorLinkTestBase(output,
"""
[](elastic/search-labs/search/req.md#sub-requirements)
[](testing/req.md#sub-requirements)
"""
)
{
Expand Down Expand Up @@ -112,7 +112,7 @@ public void HasError() => Collector.Diagnostics.Should().HaveCount(1)

public class ExternalPageBadAnchorTests(ITestOutputHelper output) : AnchorLinkTestBase(output,
"""
[Sub Requirements](elastic/search-labs/search/req.md#sub-requirements2)
[Sub Requirements](testing/req.md#sub-requirements2)
"""
)
{
Expand All @@ -127,4 +127,3 @@ public void GeneratesHtml() =>
public void HasError() => Collector.Diagnostics.Should().HaveCount(1)
.And.Contain(d => d.Message.Contains("`sub-requirements2` does not exist"));
}

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
This is a 'caution' admonition
```
""";
fileSystem.AddFile(@"docs/source/elastic/search-labs/search/req.md", inclusion);
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
}

Expand All @@ -61,7 +61,7 @@ public void GeneratesHtml() =>

public class ExternalDirectiveLinkTests(ITestOutputHelper output) : DirectiveBlockLinkTests(output,
"""
[Sub Requirements](elastic/search-labs/search/req.md#hint_ref)
[Sub Requirements](testing/req.md#hint_ref)
"""
)
{
Expand All @@ -75,4 +75,3 @@ public void GeneratesHtml() =>
[Fact]
public void HasNoErrors() => Collector.Diagnostics.Should().HaveCount(0);
}

6 changes: 3 additions & 3 deletions tests/Elastic.Markdown.Tests/Inline/InlineLinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
To follow this tutorial you will need to install the following components:
""";
fileSystem.AddFile(@"docs/source/elastic/search-labs/search/req.md", inclusion);
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
}

Expand All @@ -52,7 +52,7 @@ public void GeneratesHtml() =>

public class LinkToPageTests(ITestOutputHelper output) : LinkTestBase(output,
"""
[Requirements](elastic/search-labs/search/req.md)
[Requirements](testing/req.md)
"""
)
{
Expand All @@ -69,7 +69,7 @@ public void GeneratesHtml() =>

public class InsertPageTitleTests(ITestOutputHelper output) : LinkTestBase(output,
"""
[](elastic/search-labs/search/req.md)
[](testing/req.md)
"""
)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Elastic.Markdown.Tests/SiteMap/NavigationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public void ParsesNestedFoldersAndPrefixesPaths()
{
Configuration.ImplicitFolders.Should().NotBeNullOrEmpty();
Configuration.ImplicitFolders.Should()
.Contain("markup")
.Conta("markup")
.And.Contain("elastic/observability");
}
[Fact]
public void ParsesFilesAndPrefixesPaths() =>
Configuration.Files.Should()
.Contain("index.md")
.And.Contain("elastic/search-labs/search/req.md");
.And.Contain("testing/req.md");
}

0 comments on commit 4cd1158

Please sign in to comment.