mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
a52d56f613
Summary: - Moved /test/client and /test/common to core. - Moved two files (CircularArray and RecentItems) from app/common to core/app/common. - Moved resetOrg test to gen-server. - `testrun.sh` is now invoking common and client test from core. - Added missing packages to core's package.json (and revealed underscore as it is used in the main app). - Removed Coord.js as it is not used anywhere. Test Plan: Existing tests Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3590
19 lines
810 B
TypeScript
19 lines
810 B
TypeScript
import {getInitials} from 'app/client/ui/UserImage';
|
|
import {assert} from 'chai';
|
|
|
|
describe('AppModel', function() {
|
|
describe('getInitials', function() {
|
|
it('should extract initials', () => {
|
|
assert.equal(getInitials({name: "Foo Bar"}), "FB");
|
|
assert.equal(getInitials({name: " foo bar cat"}), "fb");
|
|
assert.equal(getInitials({name: " foo-bar cat"}), "fc");
|
|
assert.equal(getInitials({name: "foo-bar"}), "f");
|
|
assert.equal(getInitials({name: " Something"}), "S");
|
|
assert.equal(getInitials({name: " Something", email: 'test@...'}), "S");
|
|
assert.equal(getInitials({name: "", email: 'test@...'}), "t");
|
|
assert.equal(getInitials({name: " ", email: 'test@...'}), "t");
|
|
assert.equal(getInitials({email: 'something@example.com'}), "s");
|
|
});
|
|
});
|
|
});
|