Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw SupportError when instantiating components where GOV.UK Frontend is not supported #4030

Merged
merged 5 commits into from
Aug 11, 2023

Commits on Aug 11, 2023

  1. Improve hook for running code before initialisation in `renderAndInit…

    …ialise`
    
    - Clarify naming as it's actually code that runs before initialisation rather than does any kind of initialisation of the component itself
    - Update how the hook is run to be directly called by `page.evaluate`.
      Having it run as part of the function that did the initialisation didn't run reliably for updating the `govuk-frontend-supported` class,
      or even other simpler scenarios like logging or throwing. Calling it directly with `page.evaluate` seems to run more reliably.
    romaricpascal committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    b552876 View commit details
    Browse the repository at this point in the history
  2. Improve tests structure

    Adds a couple of extra `describe` to group existing tests
    in anticipation of new tests sections for the errors
    romaricpascal committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    143dc77 View commit details
    Browse the repository at this point in the history
  3. Add SupportError

    Allows components to indicate they didn't inistantiate because GOV.UK Frontend is not supported
    romaricpascal committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    b544d53 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a64c0f5 View commit details
    Browse the repository at this point in the history
  5. Refactor validation of GOV.UK Frontend support in a base class

    It's the same code for all components and the architecture we're looking to implement
    so we may as well start introducing it, keeping it internal
    romaricpascal committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    98eaeca View commit details
    Browse the repository at this point in the history