diff --git a/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx b/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx
index 7f375ef75938b..6c65eae41c78b 100644
--- a/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx
+++ b/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx
@@ -902,6 +902,10 @@ describe('ConfigureCases', () => {
expect(await screen.findByTestId('common-flyout')).toBeInTheDocument();
+ expect(await screen.findByTestId('common-flyout-header')).toHaveTextContent(
+ i18n.EDIT_CUSTOM_FIELD
+ );
+
await userEvent.click(screen.getByTestId('custom-field-label-input'));
await userEvent.paste('!!');
await userEvent.click(screen.getByTestId('text-custom-field-required'));
@@ -941,6 +945,10 @@ describe('ConfigureCases', () => {
await userEvent.click(screen.getByTestId('add-custom-field'));
expect(await screen.findByTestId('common-flyout')).toBeInTheDocument();
+
+ expect(await screen.findByTestId('common-flyout-header')).toHaveTextContent(
+ i18n.ADD_CUSTOM_FIELD
+ );
});
it('closes fly out for when click on cancel', async () => {
@@ -1177,6 +1185,10 @@ describe('ConfigureCases', () => {
expect(await screen.findByTestId('common-flyout')).toBeInTheDocument();
+ expect(await screen.findByTestId('common-flyout-header')).toHaveTextContent(
+ i18n.EDIT_TEMPLATE
+ );
+
await userEvent.clear(await screen.findByTestId('template-name-input'));
await userEvent.click(await screen.findByTestId('template-name-input'));
await userEvent.paste('Updated template name');
diff --git a/x-pack/plugins/cases/public/components/configure_cases/index.tsx b/x-pack/plugins/cases/public/components/configure_cases/index.tsx
index d26fe1ee185f8..61f99a46a0b08 100644
--- a/x-pack/plugins/cases/public/components/configure_cases/index.tsx
+++ b/x-pack/plugins/cases/public/components/configure_cases/index.tsx
@@ -484,7 +484,9 @@ export const ConfigureCases: React.FC = React.memo(() => {
}
onCloseFlyout={onCloseCustomFieldFlyout}
onSaveField={onCustomFieldSave}
- renderHeader={() => {i18n.ADD_CUSTOM_FIELD}}
+ renderHeader={() => (
+ {customFieldToEdit ? i18n.EDIT_CUSTOM_FIELD : i18n.ADD_CUSTOM_FIELD}
+ )}
>
{({ onChange }) => (
@@ -504,7 +506,9 @@ export const ConfigureCases: React.FC = React.memo(() => {
}
onCloseFlyout={onCloseTemplateFlyout}
onSaveField={onTemplateSave}
- renderHeader={() => {i18n.CREATE_TEMPLATE}}
+ renderHeader={() => (
+ {templateToEdit ? i18n.EDIT_TEMPLATE : i18n.CREATE_TEMPLATE}
+ )}
>
{({ onChange }) => (