Skip to content

Conversation

@newmaldenite
Copy link
Collaborator

Pull Request: Book List Page and CI Pipeline

This pull request introduces the first core feature of the application: a page to display a list of all books fetched from the backend API. It also establishes the foundational CI pipeline for the project.


Feature

  • Creates a new page at /books that renders a list of books.

Chore

  • Implements a GitHub Actions workflow to run npm test on all pull requests targeting the main branch.

How to Manually Test

  1. Check out this branch:

    git checkout feat/list-books
  2. Install dependencies:

    npm install
  3. Start the backend API server.

NOTE: This frontend application requires a functioning backend API to be running locally. Ensure the backend API is started and accessible before running the frontend server.

  1. Run the frontend server:

    NODE_TLS_REJECT_UNAUTHORIZED=0 npm run dev
  2. Navigate to the books page:
    Open your browser and go to http://localhost:3000/books.

Expected Result

You should see a GOV.UK-styled page with a list of books fetched from your local API.

Implements a new page at the `/books` URL that fetches a list of books from the backend API and displays them.

- Follows a strict TDD workflow, starting with a failing integration test.
- Creates a reusable API client module for interacting with the backend, configurable via environment variables.
- Establishes a robust testing pattern for mocking ES Modules using `jest.unstable_mockModule` and a dynamic import strategy.
- Refactors the complex test setup logic into a reusable `setupMockedApp` test helper to keep tests clean and DRY.
- Includes a Nunjucks template to render the book list using GOV.UK Design System components.
@newmaldenite newmaldenite merged commit a17e90a into main Nov 17, 2025
1 check passed
@newmaldenite newmaldenite deleted the feat/list-books branch November 17, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants