Skip to content

Commit

Permalink
Merge pull request #354 from openedx/jkantor/headingMessage
Browse files Browse the repository at this point in the history
fix: incorrect key breaks page
  • Loading branch information
KristinAoki authored Sep 13, 2024
2 parents 567a020 + d608dac commit 7003b61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/FilePreview/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const renderHooks = ({
message: messages.retryButton,
};
const error = {
headerMessage: errorMessage,
headingMessage: errorMessage,
children: intl.formatMessage(errorMessage),
actions: [errorAction],
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/FilePreview/hooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ describe('FilePreview hooks', () => {
});
describe('error', () => {
it('loads message from current error status, if valid, else from serverError', () => {
expect(hook.error.headerMessage).toEqual(
expect(hook.error.headingMessage).toEqual(
hooks.ERROR_STATUSES[ErrorStatuses.serverError],
);
expect(hook.error.children).toEqual(
formatMessage(hooks.ERROR_STATUSES[ErrorStatuses.serverError]),
);
state.mockVal(state.keys.errorStatus, ErrorStatuses.notFound);
hook = hooks.renderHooks({ intl: { formatMessage }, file });
expect(hook.error.headerMessage).toEqual(
expect(hook.error.headingMessage).toEqual(
hooks.ERROR_STATUSES[ErrorStatuses.notFound],
);
expect(hook.error.children).toEqual(
Expand Down

0 comments on commit 7003b61

Please sign in to comment.