Few fixes from last PR (#2160)

* Added a migration for existing ratings

* Fixed duplicating web links and changed so it has the see more functionality.

* One more unit test
This commit is contained in:
Joe Milazzo 2023-07-25 14:15:25 -05:00 committed by GitHub
parent cae8f45ad1
commit ce04e7421b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 7 deletions

View file

@ -381,6 +381,49 @@ public class ReaderServiceTests
Assert.Equal("2", actualChapter.Range);
}
[Fact]
public async Task GetNextChapterIdAsync_ShouldGetNextVolume_OnlyFloats()
{
// V1 -> V2
await ResetDb();
var series = new SeriesBuilder("Test")
.WithVolume(new VolumeBuilder("1.0")
.WithChapter(new ChapterBuilder("1").Build())
.Build())
.WithVolume(new VolumeBuilder("2.1")
.WithChapter(new ChapterBuilder("21").Build())
.Build())
.WithVolume(new VolumeBuilder("2.2")
.WithChapter(new ChapterBuilder("31").Build())
.Build())
.WithVolume(new VolumeBuilder("3.1")
.WithChapter(new ChapterBuilder("31").Build())
.Build())
.Build();
series.Library = new LibraryBuilder("Test LIb", LibraryType.Manga).Build();
_context.Series.Add(series);
_context.AppUser.Add(new AppUser()
{
UserName = "majora2007"
});
await _context.SaveChangesAsync();
var nextChapter = await _readerService.GetNextChapterIdAsync(1, 2, 2, 1);
var actualChapter = await _unitOfWork.ChapterRepository.GetChapterAsync(nextChapter);
Assert.Equal("31", actualChapter.Range);
}
[Fact]
public async Task GetNextChapterIdAsync_ShouldRollIntoNextVolume()
{