From 048bd002903c74c64272a5a713f398c4c8e913ff Mon Sep 17 00:00:00 2001 From: Jeff Daley Date: Thu, 4 Apr 2024 20:04:27 -0400 Subject: [PATCH] Reset page when clicking segmented tab --- web/app/components/projects/index.hbs | 2 +- web/tests/acceptance/authenticated/projects-test.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/web/app/components/projects/index.hbs b/web/app/components/projects/index.hbs index c761b3316..f2d5a3930 100644 --- a/web/app/components/projects/index.hbs +++ b/web/app/components/projects/index.hbs @@ -7,7 +7,7 @@ {{status.label}} diff --git a/web/tests/acceptance/authenticated/projects-test.ts b/web/tests/acceptance/authenticated/projects-test.ts index abed39d49..5a08bd37b 100644 --- a/web/tests/acceptance/authenticated/projects-test.ts +++ b/web/tests/acceptance/authenticated/projects-test.ts @@ -180,5 +180,16 @@ module("Acceptance | authenticated/projects", function (hooks) { assert .dom(getPageTwoButton()) .hasAttribute("href", "/projects?page=2&status=archived"); + + // Click a pagination link + await click(getPageTwoButton()); + assert.equal(currentURL(), "/projects?page=2&status=archived"); + + // Assert that the segmented controls have the correct hrefs (no page number) + assert.dom(ACTIVE_TAB).hasAttribute("href", "/projects"); + assert + .dom(COMPLETED_TAB) + .hasAttribute("href", "/projects?status=completed"); + assert.dom(ARCHIVED_TAB).hasAttribute("href", "/projects?status=archived"); }); });