2022-01-10 14:17:52 -08:00
|
|
|
import React from 'react';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
import { normalizeAccount } from 'soapbox/normalizers';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2022-04-04 08:53:47 -07:00
|
|
|
import { render, screen } from '../../jest/test-helpers';
|
2022-05-13 09:12:19 -07:00
|
|
|
import DisplayName from '../display-name';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-07-06 11:12:35 -07:00
|
|
|
import type { ReducerAccount } from 'soapbox/reducers/accounts';
|
|
|
|
|
2020-03-27 13:59:38 -07:00
|
|
|
describe('<DisplayName />', () => {
|
|
|
|
it('renders display name + account name', () => {
|
2022-07-06 11:12:35 -07:00
|
|
|
const account = normalizeAccount({ acct: 'bar@baz' }) as ReducerAccount;
|
2022-04-04 08:53:47 -07:00
|
|
|
render(<DisplayName account={account} />);
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2022-04-04 08:53:47 -07:00
|
|
|
expect(screen.getByTestId('display-name')).toHaveTextContent('bar@baz');
|
2020-03-27 13:59:38 -07:00
|
|
|
});
|
|
|
|
});
|