Skip to content

Commit

Permalink
feat: add message for OverlappingPriceValidity error code
Browse files Browse the repository at this point in the history
  • Loading branch information
ragafus committed May 9, 2024
1 parent f8f413c commit 868013f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,16 @@ describe('render', () => {
)
).toBeInTheDocument();
});
it('should show message for OverlappingPriceValidity', () => {
const error = {
extensions: { code: 'OverlappingPriceValidity' },
message: 'message-content',
};
renderMessage(<ApiErrorMessage error={error} />);
expect(
screen.getByText('Two prices have overlapping validity periods.')
).toBeInTheDocument();
});
it('should show message for OverlappingStandalonePriceValidity', () => {
const error = {
extensions: { code: 'OverlappingStandalonePriceValidity' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ export default defineMessages({
defaultMessage:
'Slugs may only contain alphanumeric (0-9A-Z) characters, underscores and hyphens and must have a length between 2 and 256 characters.',
},
OverlappingPriceValidity: {
id: 'ApiError.OverlappingPriceValidity',
description:
'Returned when a given price validity period conflicts with an existing one',
defaultMessage: 'Two prices have overlapping validity periods.',
},
OverlappingStandalonePriceValidity: {
id: 'ApiError.OverlappingStandalonePriceValidity',
description:
Expand Down

0 comments on commit 868013f

Please sign in to comment.