app
bin
config
db
lib
log
public
spec
controllers
fabricators
fixtures
helpers
javascript
components
avatar.test.jsx
button.test.jsx
display_name.test.jsx
dropdown_menu.test.jsx
loading_indicator.test.jsx
setup.js
lib
mailers
models
services
i18n_spec.rb
rails_helper.rb
spec_helper.rb
storybook
vendor
.babelrc
.codeclimate.yml
.dockerignore
.env.production.sample
.env.test
.eslintrc
.gitignore
.nvmrc
.rspec
.rubocop.yml
.ruby-version
.travis.yml
Dockerfile
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
Vagrantfile
config.ru
docker-compose.yml
package.json
yarn.lock
28 lines
838 B
JavaScript
28 lines
838 B
JavaScript
import { expect } from 'chai';
|
|
import { render } from 'enzyme';
|
|
import Immutable from 'immutable';
|
|
|
|
import DisplayName from '../../../app/assets/javascripts/components/components/display_name'
|
|
|
|
describe('<DisplayName />', () => {
|
|
it('renders display name + account name', () => {
|
|
const account = Immutable.fromJS({
|
|
username: 'bar',
|
|
acct: 'bar@baz',
|
|
display_name: 'Foo'
|
|
});
|
|
const wrapper = render(<DisplayName account={account} />);
|
|
expect(wrapper).to.have.text('Foo @bar@baz');
|
|
});
|
|
|
|
it('renders the username + account name if display name is empty', () => {
|
|
const account = Immutable.fromJS({
|
|
username: 'bar',
|
|
acct: 'bar@baz',
|
|
display_name: ''
|
|
});
|
|
const wrapper = render(<DisplayName account={account} />);
|
|
expect(wrapper).to.have.text('bar @bar@baz');
|
|
});
|
|
});
|