Parse Mentions as Immutable.Record

This commit is contained in:
Alex Gleason
2022-03-10 17:57:12 -06:00
parent 9afd43a42d
commit 8decaa2d9f
5 changed files with 31 additions and 43 deletions

View File

@@ -6,7 +6,6 @@ import {
isStaff,
isAdmin,
isModerator,
accountToMention,
} from '../accounts';
describe('getDomain', () => {
@@ -116,19 +115,3 @@ describe('isModerator', () => {
});
});
});
describe('accountToMention', () => {
it('converts the account to a mention', () => {
const account = fromJS(require('soapbox/__fixtures__/pleroma-account.json'));
const expected = fromJS({
id: '9v5bmRalQvjOy0ECcC',
username: 'alex',
acct: 'alex',
url: 'https://gleasonator.com/users/alex',
});
const result = accountToMention(account);
expect(result).toEqual(expected);
});
});

View File

@@ -62,12 +62,3 @@ export const isLocal = (account: ImmutableMap<string, any>): boolean => {
};
export const isRemote = (account: ImmutableMap<string, any>): boolean => !isLocal(account);
export const accountToMention = (account: ImmutableMap<string, any>): ImmutableMap<string, any> => {
return ImmutableMap({
id: account.get('id'),
username: account.get('username'),
acct: account.get('acct'),
url: account.get('url'),
});
};