Skip to content

Commit 421bab0

Browse files
committed
Added test and removed redundant code
1 parent 6b13dc9 commit 421bab0

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

LinkDotNet.Blog.IntegrationTests/Web/Shared/NavMenuTests.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using System.Linq;
2-
using AngleSharp.Dom;
2+
using AngleSharp.Html.Dom;
33
using Bunit;
44
using Bunit.TestDoubles;
55
using FluentAssertions;
66
using LinkDotNet.Blog.Web;
77
using LinkDotNet.Blog.Web.Shared;
8+
using LinkDotNet.Domain;
89
using Microsoft.AspNetCore.Components;
910
using Microsoft.Extensions.DependencyInjection;
1011
using Xunit;
@@ -50,5 +51,23 @@ public void ShouldDisplayGithubAndLinkedInPageWhenOnlyWhenSet(
5051
cut.FindAll("li").Any(l => l.TextContent.Contains("Github")).Should().Be(githubAvailable);
5152
cut.FindAll("li").Any(l => l.TextContent.Contains("LinkedIn")).Should().Be(linkedinAvailable);
5253
}
54+
55+
[Fact]
56+
public void ShouldDisplayAboutMePage()
57+
{
58+
var config = new AppConfiguration
59+
{
60+
ProfileInformation = new ProfileInformation(),
61+
};
62+
Services.AddScoped(_ => config);
63+
this.AddTestAuthorization();
64+
65+
var cut = RenderComponent<NavMenu>();
66+
67+
cut
68+
.FindAll(".nav-link").ToList()
69+
.Cast<IHtmlAnchorElement>()
70+
.Count(a => a.Href.Contains("AboutMe")).Should().Be(1);
71+
}
5372
}
5473
}

LinkDotNet.Blog.Web/Shared/SearchInput.razor

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
}
1919

2020
var trimmed = searchTerm.Trim();
21-
if (trimmed == string.Empty)
22-
{
23-
return;
24-
}
25-
2621
await SearchEntered.InvokeAsync(trimmed);
2722
}
2823

0 commit comments

Comments
 (0)