This PR adds a convenience function for clearing flash messages to align with others.
This commit is contained in:
parent
fbc0d59d78
commit
609fb0d46f
|
@ -12,4 +12,5 @@ export {
|
|||
setErrorMessage,
|
||||
setQueuedSuccessMessage,
|
||||
setQueuedErrorMessage,
|
||||
clearFlashMessages,
|
||||
} from './set_message_helpers';
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
setErrorMessage,
|
||||
setQueuedSuccessMessage,
|
||||
setQueuedErrorMessage,
|
||||
clearFlashMessages,
|
||||
} from './';
|
||||
|
||||
describe('Flash Message Helpers', () => {
|
||||
|
@ -68,4 +69,10 @@ describe('Flash Message Helpers', () => {
|
|||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('clearFlashMessages()', () => {
|
||||
clearFlashMessages();
|
||||
|
||||
expect(FlashMessagesLogic.values.messages).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -33,3 +33,7 @@ export const setQueuedErrorMessage = (message: string) => {
|
|||
message,
|
||||
});
|
||||
};
|
||||
|
||||
export const clearFlashMessages = () => {
|
||||
FlashMessagesLogic.actions.clearFlashMessages();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue