Skip to content

Commit

Permalink
Added PageNumbersAreClickable
Browse files Browse the repository at this point in the history
  • Loading branch information
math045b committed Nov 26, 2024
1 parent 0e9ee77 commit ca58ce5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Chirp/test/PlaywrightTests/UITests/PageButtonsTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Chirp.Infrastructure.Model;
using Microsoft.Playwright;
using PlaywrightTests.Utils;
using PlaywrightTests.Utils.PageTests;

Expand All @@ -7,7 +7,7 @@ namespace PlaywrightTests.UITests;
public class PageButtonsTests : PageTestWithRazorPlaywrightWebApplicationFactory
{
[Test]
public async Task PageButtons_FormatingTest()
public async Task FormatingTest()
{
//arrange
var testAuthor = new TestAuthorBuilder(RazorFactory.GetUserManager())
Expand Down Expand Up @@ -35,4 +35,21 @@ public async Task PageButtons_FormatingTest()
await Page.GotoAsync("/?page=5");
await Expect(Page.Locator("body")).ToContainTextAsync("< Prev 1 .. 4 5");
}

[Test]
public async Task PageNumbersAreClickable()
{
//arrange
var testAuthor = new TestAuthorBuilder(RazorFactory.GetUserManager())
.WithDefault()
.Create();
await GenerateCheeps(testAuthor.author, 32*5);

//first
await Page.GotoAsync("/?page=1");
await Page.GetByRole(AriaRole.Link, new() { Name = "2" }).First.ClickAsync();
Assert.That(Page.Url, Is.EqualTo($"{RazorBaseUrl}/?page=2"));
await Page.GetByRole(AriaRole.Link, new() { Name = "5" }).First.ClickAsync();
Assert.That(Page.Url, Is.EqualTo($"{RazorBaseUrl}/?page=5"));
}
}

0 comments on commit ca58ce5

Please sign in to comment.