Skip to content

Commit 4101283

Browse files
committed
Fixed Tests
1 parent 3ae9b51 commit 4101283

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/DraftBlogPostPageTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public async Task ShouldOnlyShowPublishedPosts()
2626
var cut = ctx.RenderComponent<DraftBlogPosts>();
2727
cut.WaitForState(() => cut.FindAll(".blog-card").Any());
2828

29-
3029
var blogPosts = cut.FindComponents<ShortBlogPost>();
3130

3231
blogPosts.Should().HaveCount(1);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ public async Task ShouldLoadPreviousBatchOnClick()
100100
var cut = ctx.RenderComponent<Index>();
101101
cut.WaitForState(() => cut.FindAll(".blog-card").Any());
102102
cut.FindComponent<BlogPostNavigation>().Find("li:last-child a").Click();
103+
cut.WaitForState(() => cut.FindAll(".blog-card").Count == 1);
103104

104105
cut.FindComponent<BlogPostNavigation>().Find("li:first-child a").Click();
105106

107+
cut.WaitForState(() => cut.FindAll(".blog-card").Count > 1);
106108
var blogPosts = cut.FindComponents<ShortBlogPost>();
107-
blogPosts.Count.Should().Be(1);
109+
blogPosts.Count.Should().Be(10);
108110
}
109111

110112
private static AppConfiguration CreateSampleAppConfiguration()

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Linq;
23
using System.Threading.Tasks;
34
using Bunit;
45
using FluentAssertions;
@@ -21,6 +22,7 @@ public async Task ShouldOnlyDisplayTagsGivenByParameter()
2122
await AddBlogPostWithTagAsync("Tag 2");
2223
ctx.Services.AddScoped<IRepository>(_ => BlogPostRepository);
2324
var cut = ctx.RenderComponent<SearchByTag>(p => p.Add(s => s.Tag, "Tag 1"));
25+
cut.WaitForState(() => cut.FindAll(".blog-card").Any());
2426

2527
var tags = cut.FindAll(".blog-card");
2628

@@ -34,6 +36,7 @@ public async Task ShouldHandleSpecialCharacters()
3436
await AddBlogPostWithTagAsync("C#");
3537
ctx.Services.AddScoped<IRepository>(_ => BlogPostRepository);
3638
var cut = ctx.RenderComponent<SearchByTag>(p => p.Add(s => s.Tag, Uri.EscapeDataString("C#")));
39+
cut.WaitForState(() => cut.FindAll(".blog-card").Any());
3740

3841
var tags = cut.FindAll(".blog-card");
3942

0 commit comments

Comments
 (0)