bigbuffet-rw/app/soapbox/normalizers/__tests__/mention.test.ts
marcin mikołajczak 5fec879148 Fix mutes test, prefer TypeScript for tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-06-12 16:30:48 +02:00

23 lines
658 B
TypeScript

import { Record as ImmutableRecord } from 'immutable';
import { normalizeMention } from '../mention';
describe('normalizeMention()', () => {
it('adds base fields', () => {
const account = {};
const result = normalizeMention(account);
expect(ImmutableRecord.isRecord(result)).toBe(true);
expect(result.id).toEqual('');
expect(result.acct).toEqual('');
expect(result.username).toEqual('');
expect(result.url).toEqual('');
});
it('infers username from acct', () => {
const account = { acct: 'alex@gleasonator.com' };
const result = normalizeMention(account);
expect(result.username).toEqual('alex');
});
});