Skip to content

Commit

Permalink
Update snapshots and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Aug 5, 2024
1 parent 69a0f0d commit 8a0573e
Show file tree
Hide file tree
Showing 28 changed files with 354 additions and 385 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
Tenants are useful for safely sharing your work with other OpenSearch Dashboards users. You can switch your tenant anytime by clicking the user avatar on top right.
</EuiText>
<EuiSpacer />
<EuiRadioGroup
<EuiCompressedRadioGroup
data-test-subj="tenant-switch-radios"
name="tenantSwitchRadios"
onChange={[Function]}
Expand Down Expand Up @@ -63,9 +63,9 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
]
}
/>
<EuiComboBox
<EuiCompressedComboBox
async={false}
compressed={false}
compressed={true}
fullWidth={false}
isClearable={true}
onChange={[Function]}
Expand Down Expand Up @@ -94,19 +94,19 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
<EuiSpacer />
</EuiModalBody>
<EuiModalFooter>
<EuiButtonEmpty
<EuiSmallButtonEmpty
onClick={[MockFunction]}
>
Cancel
</EuiButtonEmpty>
<EuiButton
</EuiSmallButtonEmpty>
<EuiSmallButton
data-test-subj="confirm"
disabled={false}
fill={true}
onClick={[Function]}
>
Confirm
</EuiButton>
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
</EuiOverlayMask>
Expand All @@ -133,7 +133,7 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
Tenants are useful for safely sharing your work with other OpenSearch Dashboards users. You can switch your tenant anytime by clicking the user avatar on top right.
</EuiText>
<EuiSpacer />
<EuiRadioGroup
<EuiCompressedRadioGroup
data-test-subj="tenant-switch-radios"
name="tenantSwitchRadios"
onChange={[Function]}
Expand Down Expand Up @@ -178,9 +178,9 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
]
}
/>
<EuiComboBox
<EuiCompressedComboBox
async={false}
compressed={false}
compressed={true}
fullWidth={false}
isClearable={true}
onChange={[Function]}
Expand Down Expand Up @@ -209,19 +209,19 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
<EuiSpacer />
</EuiModalBody>
<EuiModalFooter>
<EuiButtonEmpty
<EuiSmallButtonEmpty
onClick={[MockFunction]}
>
Cancel
</EuiButtonEmpty>
<EuiButton
</EuiSmallButtonEmpty>
<EuiSmallButton
data-test-subj="confirm"
disabled={false}
fill={true}
onClick={[Function]}
>
Confirm
</EuiButton>
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
</EuiOverlayMask>
Expand All @@ -248,7 +248,7 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
Tenants are useful for safely sharing your work with other OpenSearch Dashboards users. You can switch your tenant anytime by clicking the user avatar on top right.
</EuiText>
<EuiSpacer />
<EuiRadioGroup
<EuiCompressedRadioGroup
data-test-subj="tenant-switch-radios"
name="tenantSwitchRadios"
onChange={[Function]}
Expand Down Expand Up @@ -293,9 +293,9 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
]
}
/>
<EuiComboBox
<EuiCompressedComboBox
async={false}
compressed={false}
compressed={true}
fullWidth={false}
isClearable={true}
onChange={[Function]}
Expand Down Expand Up @@ -324,19 +324,19 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
<EuiSpacer />
</EuiModalBody>
<EuiModalFooter>
<EuiButtonEmpty
<EuiSmallButtonEmpty
onClick={[MockFunction]}
>
Cancel
</EuiButtonEmpty>
<EuiButton
</EuiSmallButtonEmpty>
<EuiSmallButton
data-test-subj="confirm"
disabled={false}
fill={true}
onClick={[Function]}
>
Confirm
</EuiButton>
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
</EuiOverlayMask>
Expand All @@ -363,7 +363,7 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
Tenants are useful for safely sharing your work with other OpenSearch Dashboards users. You can switch your tenant anytime by clicking the user avatar on top right.
</EuiText>
<EuiSpacer />
<EuiRadioGroup
<EuiCompressedRadioGroup
data-test-subj="tenant-switch-radios"
name="tenantSwitchRadios"
onChange={[Function]}
Expand Down Expand Up @@ -408,9 +408,9 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
]
}
/>
<EuiComboBox
<EuiCompressedComboBox
async={false}
compressed={false}
compressed={true}
fullWidth={false}
isClearable={true}
onChange={[Function]}
Expand Down Expand Up @@ -439,19 +439,19 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
<EuiSpacer />
</EuiModalBody>
<EuiModalFooter>
<EuiButtonEmpty
<EuiSmallButtonEmpty
onClick={[MockFunction]}
>
Cancel
</EuiButtonEmpty>
<EuiButton
</EuiSmallButtonEmpty>
<EuiSmallButton
data-test-subj="confirm"
disabled={false}
fill={true}
onClick={[Function]}
>
Confirm
</EuiButton>
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
</EuiOverlayMask>
Expand All @@ -478,7 +478,7 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
Tenants are useful for safely sharing your work with other OpenSearch Dashboards users. You can switch your tenant anytime by clicking the user avatar on top right.
</EuiText>
<EuiSpacer />
<EuiRadioGroup
<EuiCompressedRadioGroup
data-test-subj="tenant-switch-radios"
name="tenantSwitchRadios"
onChange={[Function]}
Expand Down Expand Up @@ -523,9 +523,9 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
]
}
/>
<EuiComboBox
<EuiCompressedComboBox
async={false}
compressed={false}
compressed={true}
fullWidth={false}
isClearable={true}
onChange={[Function]}
Expand Down Expand Up @@ -554,19 +554,19 @@ exports[`Account menu -tenant switch panel confirm button and renders renders wh
<EuiSpacer />
</EuiModalBody>
<EuiModalFooter>
<EuiButtonEmpty
<EuiSmallButtonEmpty
onClick={[MockFunction]}
>
Cancel
</EuiButtonEmpty>
<EuiButton
</EuiSmallButtonEmpty>
<EuiSmallButton
data-test-subj="confirm"
disabled={false}
fill={true}
onClick={[Function]}
>
Confirm
</EuiButton>
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
</EuiOverlayMask>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ exports[`Audit logs render when AuditLoggingSettings.enabled is true 1`] = `
</h3>
}
>
<EuiFormRow
<EuiCompressedFormRow
className="form-row"
describedByIds={Array []}
display="row"
display="rowCompressed"
fullWidth={false}
hasChildLabel={true}
hasEmptyLabelSpace={false}
Expand Down Expand Up @@ -308,7 +308,7 @@ exports[`Audit logs render when AuditLoggingSettings.enabled is true 1`] = `
href="https://opensearch.org/docs/latest/security-plugin/audit-logs/storage-types/"
/>
</EuiText>
</EuiFormRow>
</EuiCompressedFormRow>
</EuiDescribedFormGroup>
<EuiDescribedFormGroup
className="described-form-group"
Expand All @@ -318,22 +318,22 @@ exports[`Audit logs render when AuditLoggingSettings.enabled is true 1`] = `
</h3>
}
>
<EuiFormRow
<EuiCompressedFormRow
describedByIds={Array []}
display="row"
display="rowCompressed"
fullWidth={false}
hasChildLabel={true}
hasEmptyLabelSpace={false}
labelType="label"
>
<EuiSwitch
<EuiCompressedSwitch
checked={true}
data-test-subj="audit-logging-enabled-switch"
label="Enabled"
name="auditLoggingEnabledSwitch"
onChange={[Function]}
/>
</EuiFormRow>
</EuiCompressedFormRow>
</EuiDescribedFormGroup>
</EuiForm>
</EuiPanel>
Expand All @@ -352,12 +352,12 @@ exports[`Audit logs render when AuditLoggingSettings.enabled is true 1`] = `
<EuiFlexItem
grow={false}
>
<EuiButton
<EuiSmallButton
data-test-subj="general-settings-configure"
onClick={[Function]}
>
Configure
</EuiButton>
</EuiSmallButton>
</EuiFlexItem>
</EuiFlexGroup>
<EuiHorizontalRule
Expand Down Expand Up @@ -503,12 +503,12 @@ exports[`Audit logs render when AuditLoggingSettings.enabled is true 1`] = `
<EuiFlexItem
grow={false}
>
<EuiButton
<EuiSmallButton
data-test-subj="compliance-settings-configure"
onClick={[Function]}
>
Configure
</EuiButton>
</EuiSmallButton>
</EuiFlexItem>
</EuiFlexGroup>
<EuiHorizontalRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { shallow } from 'enzyme';
import { AuditLogging, renderComplianceSettings, renderGeneralSettings } from '../audit-logging';
import React from 'react';
import { EuiSwitch } from '@elastic/eui';
import { EuiCompressedSwitch } from '@elastic/eui';
import { buildHashUrl } from '../../../utils/url-builder';
import { ResourceType } from '../../../../../../common';
import {
Expand Down Expand Up @@ -61,7 +61,7 @@ describe('Audit logs', () => {
<AuditLogging coreStart={mockCoreStart as any} navigation={{} as any} />
);

const switchFound = component.find(EuiSwitch);
const switchFound = component.find(EuiCompressedSwitch);

expect(switchFound.prop('checked')).toBeFalsy();
expect(switchFound.prop('label')).toBe('Disabled');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React from 'react';
import { EditSettingGroup } from '../edit-setting-group';
import { CONFIG, SettingContent, SettingGroup } from '../constants';
import { AuditLoggingSettings, ComplianceSettings, GeneralSettings } from '../types';
import { EuiComboBox, EuiSwitch } from '@elastic/eui';
import { EuiCompressedComboBox, EuiCompressedSwitch } from '@elastic/eui';
import { stringToComboBoxOption } from '../../../utils/combo-box-utils';
import { JsonCodeEditor } from '../code-editor';
import { displayObject } from '../../../utils/display-utils';
Expand Down Expand Up @@ -82,15 +82,15 @@ describe('Edit setting', () => {
/>
);

expect(component.find(EuiSwitch).prop('checked')).toBeTruthy();
expect(component.find(EuiCompressedSwitch).prop('checked')).toBeTruthy();

expect(component.find(EuiComboBox).length).toEqual(2);
expect(component.find(EuiCompressedComboBox).length).toEqual(2);

expect(component.find(EuiComboBox).at(0).prop('selectedOptions')).toEqual(
expect(component.find(EuiCompressedComboBox).at(0).prop('selectedOptions')).toEqual(
audit.disabled_rest_categories?.map(stringToComboBoxOption)
);

expect(component.find(EuiComboBox).at(1).prop('selectedOptions')).toEqual(
expect(component.find(EuiCompressedComboBox).at(1).prop('selectedOptions')).toEqual(
compliance.read_ignore_users?.map(stringToComboBoxOption)
);

Expand Down
Loading

0 comments on commit 8a0573e

Please sign in to comment.