Show notifications when a user's profile name changes

This commit is contained in:
Scott Nonnenberg 2020-07-29 16:20:05 -07:00
parent 2f015863ca
commit d75eee015f
44 changed files with 749 additions and 194 deletions

View file

@ -6,20 +6,25 @@ describe('i18n', () => {
assert.strictEqual(i18n('random'), '');
});
it('returns message for given string', () => {
assert.equal(i18n('reportIssue'), 'Report an issue');
assert.equal(i18n('reportIssue'), ['Report an issue']);
});
it('returns message with single substitution', () => {
const actual = i18n('cannotUpdateDetail', 'https://signal.org/download');
const actual = i18n('cannotUpdateDetail', [
'https://signal.org/download',
]);
assert.equal(
actual,
'Signal Desktop failed to update, but there is a new version available. Please go to https://signal.org/download and install the new version manually, then either contact support or file a bug about this problem.'
);
});
it('returns message with multiple substitutions', () => {
const actual = i18n('theyChangedTheTimer', ['Someone', '5 minutes']);
const actual = i18n('theyChangedTheTimer', {
name: 'Someone',
time: '5 minutes',
});
assert.equal(
actual,
'Someone set the disappearing message timer to 5 minutes'
'Someone set the disappearing message time to 5 minutes.'
);
});
});