Skip to content

Commit 11ff34c

Browse files
committed
Added Title for Search for Tag Page
1 parent 67f6ba2 commit 11ff34c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

LinkDotNet.Blog.IntegrationTests/Web/Pages/SearchByTagTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
using LinkDotNet.Blog.Web.Pages;
88
using LinkDotNet.Infrastructure.Persistence;
99
using Microsoft.Extensions.DependencyInjection;
10+
using Moq;
11+
using Toolbelt.Blazor.HeadElement;
1012
using Xunit;
1113

1214
namespace LinkDotNet.Blog.IntegrationTests.Web.Pages
@@ -21,6 +23,7 @@ public async Task ShouldOnlyDisplayTagsGivenByParameter()
2123
await AddBlogPostWithTagAsync("Tag 1");
2224
await AddBlogPostWithTagAsync("Tag 2");
2325
ctx.Services.AddScoped<IRepository>(_ => BlogPostRepository);
26+
ctx.Services.AddScoped(_ => new Mock<IHeadElementHelper>().Object);
2427
var cut = ctx.RenderComponent<SearchByTag>(p => p.Add(s => s.Tag, "Tag 1"));
2528
cut.WaitForState(() => cut.FindAll(".blog-card").Any());
2629

@@ -35,6 +38,7 @@ public async Task ShouldHandleSpecialCharacters()
3538
using var ctx = new TestContext();
3639
await AddBlogPostWithTagAsync("C#");
3740
ctx.Services.AddScoped<IRepository>(_ => BlogPostRepository);
41+
ctx.Services.AddScoped(_ => new Mock<IHeadElementHelper>().Object);
3842
var cut = ctx.RenderComponent<SearchByTag>(p => p.Add(s => s.Tag, Uri.EscapeDataString("C#")));
3943
cut.WaitForState(() => cut.FindAll(".blog-card").Any());
4044

LinkDotNet.Blog.Web/Pages/SearchByTag.razor

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
@page "/searchByTag/{tag}"
22
@using LinkDotNet.Domain
33
@using LinkDotNet.Infrastructure.Persistence
4+
@using Toolbelt.Blazor.HeadElement
45
@inject IRepository repository
56

7+
<Title>Search for tag: @Tag</Title>
68
<h3>All posts with Tag <em>@Tag</em></h3>
79

810
@for (var i = 0; i < blogPosts.Count; i++)

0 commit comments

Comments
 (0)