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: add-optional-query-params-to-start #7

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Conversation

ryanbas21
Copy link
Collaborator

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-3647

Description

adds ability to add query parameters to the start call

Copy link

changeset-bot bot commented Jan 28, 2025

🦋 Changeset detected

Latest commit: 6ce29c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@forgerock/davinci-client Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

nx-cloud bot commented Jan 28, 2025

View your CI Pipeline Execution ↗ for commit 6ce29c4.

Command Status Duration Result
nx affected -t typecheck build lint test docs e... ✅ Succeeded 1m 33s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-30 21:30:18 UTC

@ryanbas21 ryanbas21 force-pushed the query-params-to-start branch from 07c344f to 6959be7 Compare January 28, 2025 22:22
clientId: '724ec718-c41c-4d51-98b0-84a583f450f9',
redirectUri: window.location.href,
redirectUri: window.location.origin + '/',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because i added query params to the testing, i just appended the '/' since it's stripped when using origin.

@@ -178,7 +179,21 @@ const config = {
console.log('Event emitted from store:', node);
});

const node = await davinciClient.start();
const qs = window.location.search;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

logic so that we can pull query params dynamically in tests

"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
"include": ["./main.ts", "components/**/*.ts"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

was causing issues with module resolution not using Bundler since there is no src dir here

@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"moduleResolution": "NodeNext",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think this was me debugging but should be a noop since this affects test files.

@@ -26,3 +26,45 @@ test('Test happy paths on test page', async ({ page }) => {
const accessToken = await page.locator('#accessTokenValue').innerText();
await expect(accessToken).toBeTruthy();
});
test('ensure query params passed to start are sent off in authorize call', async ({ page }) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

copy pasted above test, passed in a query param and then also added a few other query params from authorize specifically to make sure thats what we are testing

@ryanbas21 ryanbas21 force-pushed the query-params-to-start branch from 6959be7 to 239d016 Compare January 28, 2025 22:27
@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 15.38462% with 33 lines in your changes missing coverage. Please review.

Project coverage is 54.12%. Comparing base (ee8c7aa) to head (6ce29c4).

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/davinci.api.ts 0.00% 23 Missing ⚠️
packages/davinci-client/src/lib/client.store.ts 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
+ Coverage   45.73%   54.12%   +8.39%     
==========================================
  Files          18       13       -5     
  Lines        2003     1637     -366     
  Branches      123      111      -12     
==========================================
- Hits          916      886      -30     
+ Misses       1087      751     -336     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ryanbas21 ryanbas21 force-pushed the query-params-to-start branch from 239d016 to dc96747 Compare January 30, 2025 21:24
adds ability to add query parameters to the start call
@ryanbas21 ryanbas21 force-pushed the query-params-to-start branch from dc96747 to 6ce29c4 Compare January 30, 2025 21:27
@ryanbas21 ryanbas21 merged commit e12d8c0 into main Jan 30, 2025
4 checks passed
@ryanbas21 ryanbas21 deleted the query-params-to-start branch January 30, 2025 21:53
@github-actions github-actions bot mentioned this pull request Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants