diff --git a/features/articles_page_size_memory.feature b/features/articles_page_size_memory.feature new file mode 100644 index 0000000..65d4faf --- /dev/null +++ b/features/articles_page_size_memory.feature @@ -0,0 +1,115 @@ +Feature: Articles list remembers the chosen page size + + As a verified RenewCMS user + I want the page size I choose on the Articles list to be remembered + So that I do not have to pick it again each time I come back or refresh + + Background: + Given this slice amends features/articles_pagination_screen.feature; the URL keeps ?size= as in that spec and no visual or API change is made (docs/design/ is untouched) + And the size options stay "5 per page", "25 per page", "50 per page", "100 per page" and the default stays 25 + And the chosen size is stored in localStorage under the key renewcms-page-size-articles as the bare number (for example 5), one key per paginated list; only the Articles list uses it today + And only choosing a size in the page-size select writes the stored value; loading a URL never writes it + And an explicit valid ?size= in the URL is authoritative for that load and does not change the stored value + And an invalid ?size= in the URL falls back to 25, never to the stored value, and is replaced in the URL (features/articles_pagination_screen.feature scenario 10b) + And a stored value that is not 5, 25, 50 or 100 is treated as absent + And localStorage that is unavailable or throws on read or write never raises an error or breaks the page: reads act as absent and writes are ignored + And logout does not clear the stored size + And a size change still resets page to 1 and drops page from the URL + And the requests are GET /v1/article/?format=html&page=P&size=S&q=Q&status=T as in features/articles_pagination_api.feature + + Scenario Outline: Choosing a size stores it + Given nothing is stored and the user is on /article + When the user chooses "