Merge pull request #176 from BinaryAlley/bugfix/fix-flaky-genre-collision-in-book-alpha-filter-tests

Bugfix/fix flaky genre collision in book alpha filter tests
This commit is contained in:
BinaryAlley authored and GitHub committed 2026-08-25 09:09:13 -07:00
commit 9ae8c0c394
2 files changed
+20 -18

No files matched your search

@@ -18,6 +18,8 @@
@inject IUrlService _urlService @inject IUrlService _urlService
@inject IViewLocalizer _localizer @inject IViewLocalizer _localizer
@Html.AntiForgeryToken()
<div style="display: grid; grid-template-rows: auto 1fr;"><!--container with two rows, one fixed, one filling remaining space--> <div style="display: grid; grid-template-rows: auto 1fr;"><!--container with two rows, one fixed, one filling remaining space-->
<div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position--> <div style="min-height: 1rem;"></div><!--the first row is a dummy row for "margin", because setting a margin on the next row would offset the parent's position-->
<div class="enlightenment-panel shadow-effect mx-auto panel w-75 mb-10" style="min-width: 320px;"> <div class="enlightenment-panel shadow-effect mx-auto panel w-75 mb-10" style="min-width: 320px;">
@@ -47,9 +47,9 @@ public class BookAlphaFilterSpecificationTests : IDisposable
{ {
// Arrange // Arrange
List<BookEntity> books = await SeedBooksAsync( List<BookEntity> books = await SeedBooksAsync(
_bookEntityFixture.Create(title: "The Fellowship of the Ring"), _bookEntityFixture.Create(title: "The Fellowship of the Ring", includeMetadata: false),
_bookEntityFixture.Create(title: "1984"), _bookEntityFixture.Create(title: "1984", includeMetadata: false),
_bookEntityFixture.Create(title: "@home")); _bookEntityFixture.Create(title: "@home", includeMetadata: false));
BookAlphaFilterSpecification specification = new(null, false); BookAlphaFilterSpecification specification = new(null, false);
// Act // Act
@@ -64,9 +64,9 @@ public class BookAlphaFilterSpecificationTests : IDisposable
{ {
// Arrange // Arrange
List<BookEntity> books = await SeedBooksAsync( List<BookEntity> books = await SeedBooksAsync(
_bookEntityFixture.Create(title: "The Fellowship of the Ring"), _bookEntityFixture.Create(title: "The Fellowship of the Ring", includeMetadata: false),
_bookEntityFixture.Create(title: "1984"), _bookEntityFixture.Create(title: "1984", includeMetadata: false),
_bookEntityFixture.Create(title: "Zoo")); _bookEntityFixture.Create(title: "Zoo", includeMetadata: false));
BookAlphaFilterSpecification specification = new("T", false); BookAlphaFilterSpecification specification = new("T", false);
// Act // Act
@@ -82,8 +82,8 @@ public class BookAlphaFilterSpecificationTests : IDisposable
{ {
// Arrange // Arrange
await SeedBooksAsync( await SeedBooksAsync(
_bookEntityFixture.Create(title: "Zoo"), _bookEntityFixture.Create(title: "Zoo", includeMetadata: false),
_bookEntityFixture.Create(title: "moby dick")); _bookEntityFixture.Create(title: "moby dick", includeMetadata: false));
BookAlphaFilterSpecification specification = new("Z", false); BookAlphaFilterSpecification specification = new("Z", false);
// Act // Act
@@ -99,8 +99,8 @@ public class BookAlphaFilterSpecificationTests : IDisposable
{ {
// Arrange // Arrange
List<BookEntity> books = await SeedBooksAsync( List<BookEntity> books = await SeedBooksAsync(
_bookEntityFixture.Create(title: "1984"), _bookEntityFixture.Create(title: "1984", includeMetadata: false),
_bookEntityFixture.Create(title: "The Fellowship of the Ring")); _bookEntityFixture.Create(title: "The Fellowship of the Ring", includeMetadata: false));
BookAlphaFilterSpecification specification = new(LibraryItemAlphaKeys.NUMBER, false); BookAlphaFilterSpecification specification = new(LibraryItemAlphaKeys.NUMBER, false);
// Act // Act
@@ -116,9 +116,9 @@ public class BookAlphaFilterSpecificationTests : IDisposable
{ {
// Arrange // Arrange
List<BookEntity> books = await SeedBooksAsync( List<BookEntity> books = await SeedBooksAsync(
_bookEntityFixture.Create(title: "@home"), _bookEntityFixture.Create(title: "@home", includeMetadata: false),
_bookEntityFixture.Create(title: "1984"), _bookEntityFixture.Create(title: "1984", includeMetadata: false),
_bookEntityFixture.Create(title: "Zoo")); _bookEntityFixture.Create(title: "Zoo", includeMetadata: false));
BookAlphaFilterSpecification specification = new(LibraryItemAlphaKeys.SYMBOL, false); BookAlphaFilterSpecification specification = new(LibraryItemAlphaKeys.SYMBOL, false);
// Act // Act
@@ -134,8 +134,8 @@ public class BookAlphaFilterSpecificationTests : IDisposable
{ {
// Arrange // Arrange
List<BookEntity> books = await SeedBooksAsync( List<BookEntity> books = await SeedBooksAsync(
_bookEntityFixture.Create(title: "The Fellowship of the Ring"), _bookEntityFixture.Create(title: "The Fellowship of the Ring", includeMetadata: false),
_bookEntityFixture.Create(title: "To Kill a Mockingbird")); _bookEntityFixture.Create(title: "To Kill a Mockingbird", includeMetadata: false));
BookAlphaFilterSpecification specification = new("T", true); BookAlphaFilterSpecification specification = new("T", true);
// Act // Act
@@ -151,8 +151,8 @@ public class BookAlphaFilterSpecificationTests : IDisposable
{ {
// Arrange // Arrange
await SeedBooksAsync( await SeedBooksAsync(
_bookEntityFixture.Create(title: "The Fellowship of the Ring"), _bookEntityFixture.Create(title: "The Fellowship of the Ring", includeMetadata: false),
_bookEntityFixture.Create(title: "To Kill a Mockingbird")); _bookEntityFixture.Create(title: "To Kill a Mockingbird", includeMetadata: false));
BookAlphaFilterSpecification specification = new("T", false); BookAlphaFilterSpecification specification = new("T", false);
// Act // Act
@@ -166,7 +166,7 @@ public class BookAlphaFilterSpecificationTests : IDisposable
public async Task ToExpression_WhenTitleIsEmpty_ShouldFallBackToOriginalTitle() public async Task ToExpression_WhenTitleIsEmpty_ShouldFallBackToOriginalTitle()
{ {
// Arrange // Arrange
await SeedBooksAsync(_bookEntityFixture.Create(title: string.Empty, originalTitle: "The Real Title")); await SeedBooksAsync(_bookEntityFixture.Create(title: string.Empty, originalTitle: "The Real Title", includeMetadata: false));
BookAlphaFilterSpecification specification = new("T", false); BookAlphaFilterSpecification specification = new("T", false);
// Act // Act