Make eslint happy
This commit is contained in:
parent
672d5080ad
commit
2acd42e7c5
2 changed files with 20 additions and 13 deletions
|
@ -52,9 +52,13 @@ export default function SenderProfile(props) {
|
|||
|
||||
return (
|
||||
<div className="mx_SenderProfile" dir="auto" onClick={props.onClick}>
|
||||
{ content.props.children[0] ? <span className='mx_SenderProfile_aux'>{ content.props.children[0] }</span> : '' }
|
||||
{ content.props.children[0] ?
|
||||
<span className='mx_SenderProfile_aux'>{ content.props.children[0] }</span> : ''
|
||||
}
|
||||
{ content.props.children[1] }
|
||||
{ content.props.children[2] ? <span className='mx_SenderProfile_aux'>{ content.props.children[2] }</span> : '' }
|
||||
{ content.props.children[2] ?
|
||||
<span className='mx_SenderProfile_aux'>{ content.props.children[2] }</span> : ''
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -26,35 +26,38 @@ describe('languageHandler', function() {
|
|||
});
|
||||
|
||||
it('handles plurals', function() {
|
||||
var text = 'and %(count)s others...';
|
||||
const text = 'and %(count)s others...';
|
||||
expect(languageHandler._t(text, { count: 1 })).toBe('and one other...');
|
||||
expect(languageHandler._t(text, { count: 2 })).toBe('and 2 others...');
|
||||
});
|
||||
|
||||
it('handles simple variable subsitutions', function() {
|
||||
var text = 'You are now ignoring %(userId)s';
|
||||
const text = 'You are now ignoring %(userId)s';
|
||||
expect(languageHandler._t(text, { userId: 'foo' })).toBe('You are now ignoring foo');
|
||||
});
|
||||
|
||||
it('handles simple tag substitution', function() {
|
||||
var text = 'Press <StartChatButton> to start a chat with someone';
|
||||
expect(languageHandler._t(text, {}, { 'StartChatButton': () => 'foo' })).toBe('Press foo to start a chat with someone');
|
||||
const text = 'Press <StartChatButton> to start a chat with someone';
|
||||
expect(languageHandler._t(text, {}, { 'StartChatButton': () => 'foo' }))
|
||||
.toBe('Press foo to start a chat with someone');
|
||||
});
|
||||
|
||||
it('handles text in tags', function() {
|
||||
var text = '<a>Click here</a> to join the discussion!';
|
||||
expect(languageHandler._t(text, {}, { 'a': (sub) => `x${sub}x` })).toBe('xClick herex to join the discussion!');
|
||||
const text = '<a>Click here</a> to join the discussion!';
|
||||
expect(languageHandler._t(text, {}, { 'a': (sub) => `x${sub}x` }))
|
||||
.toBe('xClick herex to join the discussion!');
|
||||
});
|
||||
|
||||
it('variable substitution with React component', function() {
|
||||
// Need an extra space at the end because the result of _t() has an extra empty node at the end
|
||||
var text = 'You are now ignoring %(userId)s ';
|
||||
expect(JSON.stringify(languageHandler._t(text, { userId: () => <i>foo</i> }))).toBe(JSON.stringify((<span>You are now ignoring <i>foo</i> </span>)));
|
||||
const text = 'You are now ignoring %(userId)s ';
|
||||
expect(JSON.stringify(languageHandler._t(text, { userId: () => <i>foo</i> })))
|
||||
.toBe(JSON.stringify((<span>You are now ignoring <i>foo</i> </span>)));
|
||||
});
|
||||
|
||||
it('tag substitution with React component', function() {
|
||||
var text = 'Press <StartChatButton> to start a chat with someone';
|
||||
expect(JSON.stringify(languageHandler._t(text, {}, { 'StartChatButton': () => <i>foo</i> }))).toBe(JSON.stringify(<span>Press <i>foo</i> to start a chat with someone</span>));
|
||||
|
||||
const text = 'Press <StartChatButton> to start a chat with someone';
|
||||
expect(JSON.stringify(languageHandler._t(text, {}, { 'StartChatButton': () => <i>foo</i> })))
|
||||
.toBe(JSON.stringify(<span>Press <i>foo</i> to start a chat with someone</span>));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue