Skip to content

Commit 9e5ce1e

Browse files
committed
When Grouping in Archive, don't depend on Id as sort criteria
1 parent f8b757b commit 9e5ce1e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/LinkDotNet.Blog.Web/Features/Archive/ArchivePage.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
{
3232
blogPostsPerYear = (await repository.GetAllAsync(p => p.IsPublished))
3333
.GroupBy(r => r.UpdatedDate.Year)
34+
.OrderByDescending(r => r.Key)
3435
.ToList();
3536
}
3637

tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Archive/ArchivePageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public async Task ShouldDisplayAllBlogPosts()
2121

2222
var cut = ctx.RenderComponent<ArchivePage>();
2323

24-
cut.WaitForState(() => cut.FindAll("h2").Count == 2);
24+
cut.WaitForElements("h2");
2525
var yearHeader = cut.FindAll("h2");
2626
yearHeader.Should().HaveCount(2);
2727
yearHeader[0].TextContent.Should().Be("2022");

0 commit comments

Comments
 (0)