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

fix: fix enable for entities and add it for OAuth #964

Merged

Conversation

soleksy-splunk
Copy link
Contributor

@soleksy-splunk soleksy-splunk commented Dec 4, 2023

As a replacement for account_hook.js for repo https://github.com/splunk/splunk-add-on-for-okta-identity-cloud
parent ticket https://splunk.atlassian.net/browse/ADDON-65747

fix for enable property for every entity/field and adding support of it for oauth fields
https://splunk.github.io/addonfactory-ucc-generator/entity/

Adding tests for default value in oauth fields, logic existed there it was just not permitted in schema.

@soleksy-splunk soleksy-splunk added the run-ui-tests If set on PR, UI tests will be run label Dec 4, 2023
@@ -87,26 +150,72 @@ describe('EntityModal - Oauth oauth', () => {
renderModalWithProps(props);
const oauthTextBox = getDisabledOauthField();
expect(oauthTextBox).toBeInTheDocument();
expect(oauthTextBox?.getAttribute('disabled')).toBeNull();
expect(oauthTextBox?.getAttribute('disabled')).toBe('');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(oauthTextBox?.getAttribute('disabled')).toBe('');
expect(oauthTextBox).toHaveAttribute('disabled');

the current version:
image

my suggestion:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

but it is not...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea sorry, somehow i missed 2 out of 8 lines, should be done now

renderModalWithProps(props);

const oauthTextBox = getDisabledOauthField();
expect(oauthTextBox).toBeInTheDocument();
expect(oauthTextBox?.getAttribute('disabled')).toBe('');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(oauthTextBox?.getAttribute('disabled')).toBe('');
expect(oauthTextBox).not.toHaveAttribute('disabled');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

but it is not ..?

@soleksy-splunk soleksy-splunk force-pushed the fix/support-enable-for-Oauth-fields-in-global-config branch from 90f37f5 to bd35d3c Compare December 12, 2023 12:30
@@ -87,26 +150,72 @@ describe('EntityModal - Oauth oauth', () => {
renderModalWithProps(props);
const oauthTextBox = getDisabledOauthField();
expect(oauthTextBox).toBeInTheDocument();
expect(oauthTextBox?.getAttribute('disabled')).toBeNull();
expect(oauthTextBox?.getAttribute('disabled')).toBe('');
Copy link
Contributor

Choose a reason for hiding this comment

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

but it is not...?

renderModalWithProps(props);

const oauthTextBox = getDisabledOauthField();
expect(oauthTextBox).toBeInTheDocument();
expect(oauthTextBox?.getAttribute('disabled')).toBe('');
Copy link
Contributor

Choose a reason for hiding this comment

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

but it is not ..?

Copy link
Member

@artemrys artemrys left a comment

Choose a reason for hiding this comment

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

@soleksy-splunk please merge when you are ready :)

@soleksy-splunk soleksy-splunk merged commit 21bb7f8 into develop Dec 14, 2023
@soleksy-splunk soleksy-splunk deleted the fix/support-enable-for-Oauth-fields-in-global-config branch December 14, 2023 13:20
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
@artemrys artemrys changed the title fix: fix enable for entities and add it for oauth fix: fix enable for entities and add it for OAuth Jan 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
run-ui-tests If set on PR, UI tests will be run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants