2016-10-17 20:54:49 -04:00
|
|
|
import { expect } from 'chai';
|
|
|
|
import { render } from 'enzyme';
|
2017-07-10 19:00:14 -04:00
|
|
|
import { fromJS } from 'immutable';
|
2017-06-01 11:27:15 -04:00
|
|
|
import React from 'react';
|
|
|
|
import DisplayName from '../../../app/javascript/mastodon/components/display_name';
|
2016-10-17 20:54:49 -04:00
|
|
|
|
|
|
|
describe('<DisplayName />', () => {
|
2016-10-20 11:34:44 -04:00
|
|
|
it('renders display name + account name', () => {
|
2017-07-10 19:00:14 -04:00
|
|
|
const account = fromJS({
|
2016-10-20 11:34:44 -04:00
|
|
|
username: 'bar',
|
|
|
|
acct: 'bar@baz',
|
2017-08-07 14:32:03 -04:00
|
|
|
display_name_html: '<p>Foo</p>',
|
2016-10-20 11:34:44 -04:00
|
|
|
});
|
|
|
|
const wrapper = render(<DisplayName account={account} />);
|
|
|
|
expect(wrapper).to.have.text('Foo @bar@baz');
|
2016-10-17 20:54:49 -04:00
|
|
|
});
|
|
|
|
});
|