+
Skip to content

Refactor createRegisterUrl() and add tests #80

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

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

jonkoops
Copy link
Contributor

Closes #79

@jonkoops jonkoops requested a review from Copilot April 25, 2025 16:17
@jonkoops jonkoops self-assigned this Apr 25, 2025
@jonkoops jonkoops requested a review from a team April 25, 2025 16:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the createRegisterUrl functionality to use a more concise implementation and adds tests to validate its behavior, closing #79.

  • Refactored createRegisterUrl in lib/keycloak.js to use object-spread for setting the register action.
  • Added new tests in test/tests/register-url.spec.ts for both registration URL with all options and with default options.
  • Updated test executor in test/support/test-executor.ts to expose createRegisterUrl for testing.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/tests/register-url.spec.ts Added tests that validate the registration URL endpoints and query parameters.
test/support/test-executor.ts Introduced a createRegisterUrl method to bridge test calls with the Keycloak client.
lib/keycloak.js Refactored createRegisterUrl to use a spread operator, simplifying the previous conditional logic.

@jonkoops jonkoops force-pushed the refactor-register-url branch from 923d314 to a7855a9 Compare April 25, 2025 16:18
douglaspalmer
douglaspalmer previously approved these changes Apr 25, 2025
Copy link

@douglaspalmer douglaspalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Closes keycloak#79

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops jonkoops merged commit 21fc968 into keycloak:main Apr 25, 2025
4 checks passed
@jonkoops jonkoops deleted the refactor-register-url branch April 25, 2025 16:39
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.

Refactor createRegisterUrl() and add tests
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载