Parse Mentions as Immutable.Record
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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'),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user