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

feat(DTFS2-6892): add schema tests for commonised tfm user #4034

Merged

Conversation

AlexBramhill
Copy link
Contributor

@AlexBramhill AlexBramhill commented Dec 4, 2024

Introduction ✏️

We need to add new tests for tfm user

Resolution ✔️

The existing needed to be improved to be more scalable, this has been refactored to allow ease of use and time savings

It creates a series of chainable withSomethingTests that can be called easily via withSchemaValidationTests. It then automatically creates all required tests based on the test cases, and the supplied test case type.

It is easily extendable (all existing patterns are established), and easy to use to write tests.

  withSchemaValidationTests({
    schema: DECODED_AUTH_CODE_REQUEST_STATE_SCHEMA,
    aValidPayload,
    testCases: [
      {
        parameterPath: 'csrfToken',
        type: 'string',
      },
      {
        parameterPath: 'successRedirect',
        type: 'string',
        options: { isOptional: true },
      },
    ],
  });

@AlexBramhill AlexBramhill merged commit 3b421ce into main Feb 13, 2025
238 of 239 checks passed
@AlexBramhill AlexBramhill deleted the feat/DTFS2-6892/add-schema-tests-for-commonised-tfm-user branch February 13, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants