diff --git a/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_OneRequirementWithTwoSchemes_HasNoTabsAndShowsBothSchemes.verified.html b/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_OneRequirementWithTwoSchemes_HasNoTabsAndShowsBothSchemes.verified.html new file mode 100644 index 0000000000..ae7982c115 --- /dev/null +++ b/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_OneRequirementWithTwoSchemes_HasNoTabsAndShowsBothSchemes.verified.html @@ -0,0 +1,39 @@ +
diff --git a/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_PrivilegesNeededTogether_AreSummarisedAsSeparateNamesJoinedWithPlus.verified.html b/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_PrivilegesNeededTogether_AreSummarisedAsSeparateNamesJoinedWithPlus.verified.html new file mode 100644 index 0000000000..fe2909fe9a --- /dev/null +++ b/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_PrivilegesNeededTogether_AreSummarisedAsSeparateNamesJoinedWithPlus.verified.html @@ -0,0 +1,29 @@ + diff --git a/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_RequirementWithTwoSchemes_SharesOneTabAndSaysToSendBoth.verified.html b/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_RequirementWithTwoSchemes_SharesOneTabAndSaysToSendBoth.verified.html new file mode 100644 index 0000000000..db8af01f5d --- /dev/null +++ b/tests/Elastic.ApiExplorer.Tests/.snapshots/AuthorizationSectionRenderingTests/Render_RequirementWithTwoSchemes_SharesOneTabAndSaysToSendBoth.verified.html @@ -0,0 +1,53 @@ + diff --git a/tests/Elastic.ApiExplorer.Tests/AuthorizationSectionRenderingTests.cs b/tests/Elastic.ApiExplorer.Tests/AuthorizationSectionRenderingTests.cs index c9947ecfc9..62f499e3c2 100644 --- a/tests/Elastic.ApiExplorer.Tests/AuthorizationSectionRenderingTests.cs +++ b/tests/Elastic.ApiExplorer.Tests/AuthorizationSectionRenderingTests.cs @@ -6,6 +6,7 @@ using Elastic.ApiExplorer.Operations; using Elastic.ApiExplorer.Operations._Partials; using Microsoft.AspNetCore.Html; +using Nullean.Snapshots.Html; using RazorSlices; namespace Elastic.ApiExplorer.Tests; @@ -54,10 +55,8 @@ public async Task Render_RequirementWithTwoSchemes_SharesOneTabAndSaysToSendBoth new AuthRequirement([Scheme("bearer", "Bearer", "Authorization: Bearer");
- html.Should().Contain("");
- html.Should().Contain("api-param-summary is-all");
- html.Should().Contain("id=\"required-privileges-list\"");
- html.Should().Contain("id=\"required-privileges-list\">", "the body has no hidden attribute, so it shows on load");
- html.Should().NotContain("id=\"required-privileges-list\" hidden");
- html.Should().MatchRegex("aria-expanded=\"true\"\\s+aria-controls=\"required-privileges-list\"");
- html.Should().Contain("integrations-all", "the rows are still listed in the body");
+ html.Should().MatchHtmlSnapshot();
+ html.Should().NotContain("id=\"required-privileges-list\" hidden", "the body has no hidden attribute, so it shows on load");
}
[Test]