Normalize mentions, add tests

This commit is contained in:
Alex Gleason
2022-02-23 22:31:35 -05:00
parent 02f05abeaa
commit 331b239cc9
3 changed files with 29 additions and 6 deletions

View File

@ -32,7 +32,7 @@ const baseStatus = ImmutableMap({
const mergeDefined = (oldVal, newVal) => oldVal === undefined ? newVal : oldVal;
// Merge base status
const setRequiredFields = status => {
const mergeBase = status => {
return status.mergeDeepWith(mergeDefined, baseStatus);
};
@ -121,7 +121,7 @@ const fixQuote = status => {
export const normalizeStatus = status => {
return status.withMutations(status => {
setRequiredFields(status);
mergeBase(status);
normalizeAttachments(status);
normalizeMentions(status);
fixMentionsOrder(status);