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

[ResponseOps][Connectors] Remove feature flag for ServiceNow additional fields #186949

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,16 @@ describe('Credentials', () => {
expect(await screen.findByText(value)).toBeInTheDocument();
});

/**
* Test for the intermediate release process
*/
it('does not show the component if the value is undefined', async () => {
render(
<IntlProvider locale="en">
<AdditionalFields {...props} value={undefined} />
</IntlProvider>
);

expect(screen.queryByTestId('additional_fieldsJsonEditor')).not.toBeInTheDocument();
});

it('changes the value correctly', async () => {
const newValue = JSON.stringify({ bar: 'test' });

render(
<IntlProvider locale="en">
<AdditionalFields {...props} />
<AdditionalFields {...props} value={undefined} />
</IntlProvider>
);

const editor = await screen.findByTestId('additional_fieldsJsonEditor');

userEvent.clear(editor);
userEvent.paste(editor, newValue);
userEvent.paste(await screen.findByTestId('additional_fieldsJsonEditor'), newValue);

await waitFor(() => {
expect(onChange).toHaveBeenCalledWith(newValue);
Expand All @@ -75,7 +59,7 @@ describe('Credentials', () => {

render(
<IntlProvider locale="en">
<AdditionalFields {...props} />
<AdditionalFields {...props} value={undefined} />
</IntlProvider>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ export const AdditionalFieldsComponent: React.FC<AdditionalFieldsProps> = ({
messageVariables,
onChange,
}) => {
/**
* Hide the component if the value is not defined.
* This is needed for the intermediate release process.
* Users will not be able to use the field if they have never set it.
* On the next Serverless release the check will be removed.
*/
if (value === undefined) {
return null;
}

return (
<JsonEditorWithMessageVariables
messageVariables={messageVariables}
Expand Down