Skip to content

Commit

Permalink
revert test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Nov 29, 2024
1 parent 0bb039f commit 39dc9e3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
2 changes: 0 additions & 2 deletions lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const VersionHistoryPane = ({
onClose,
onSelectVersion,
hiddenFields = [],
systemUpdatedFields = [],
labelsMap,
versions,
}) => {
Expand Down Expand Up @@ -144,7 +143,6 @@ VersionHistoryPane.propTypes = {
onSelectVersion: PropTypes.func.isRequired,
labelsMap: PropTypes.object.isRequired,
hiddenFields: PropTypes.arrayOf(PropTypes.string),
systemUpdatedFields: PropTypes.arrayOf(PropTypes.string),
versions: PropTypes.arrayOf(PropTypes.object).isRequired,
};

Expand Down
16 changes: 0 additions & 16 deletions lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,6 @@ describe('VersionHistoryPane', () => {
expect(screen.getByText('stripes-acq-components.fundDistribution.value')).toBeInTheDocument();
});

it('should display "System maintenance update" label if there is only system changes', () => {
const clonedAuditEvent = Object.assign(cloneDeep(orderLineAuditEvent), { id: TEST_ID });

set(clonedAuditEvent.orderLineSnapshot, 'searchLocationId[0]', 'locationId');

renderVersionHistoryPane({
versions: [
clonedAuditEvent,
orderLineAuditEvent,
],
systemUpdatedFields: ['searchLocationId'],
});

expect(screen.getByText(/systemChange/)).toBeInTheDocument();
});

it('should not display version cards without changed fields', () => {
const clonedAuditEvent = Object.assign(cloneDeep(orderLineAuditEvent), { id: TEST_ID });

Expand Down
2 changes: 1 addition & 1 deletion lib/VersionHistory/getFieldLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getFieldLabels = (intl, paths, labelsMap = {}, hiddenFields = []) =

return paths.reduce((acc, path) => {
const fieldLabel = labelsMapEntries.find(([fieldPath]) => {
const regex = new RegExp(`^${escapeRegExp(fieldPath).replace('\\\\d', '\\d')}$`);
const regex = new RegExp(`^${escapeRegExp(fieldPath).replaceAll('\\\\d', '\\d')}$`);

return regex.test(path);
})?.[1] || path;
Expand Down
2 changes: 1 addition & 1 deletion lib/VersionHistory/getVersionMetadata.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('getVersionMetadata', () => {
expect(getVersionMetadata(version, entity)).toEqual({
metadataKey: 'metadataValue',
updatedByUserId: 'userId',
updatedDate: version.eventDate,
updatedDate: version.actionDate,
...entity.metadata,
});
});
Expand Down

0 comments on commit 39dc9e3

Please sign in to comment.