gristlabs_grist-core/test/client/ui/AccountPage.ts
Jarosław Sadziński a52d56f613 (core) Moving client and common tests to core
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
2022-08-23 19:20:10 +02:00

33 lines
1.1 KiB
TypeScript

import {checkName} from 'app/client/ui/AccountPage';
import {assert} from 'chai';
describe("AccountPage", function() {
describe("isValidName", function() {
it("should detect invalid name", function() {
assert.equal(checkName('santa'), true);
assert.equal(checkName('_santa'), true);
assert.equal(checkName("O'Neil"), true);
assert.equal(checkName("Emily"), true);
assert.equal(checkName("santa(2)"), true);
assert.equal(checkName("Dr. noname"), true);
assert.equal(checkName("santa-klaus"), true);
assert.equal(checkName("Noémie"), true);
assert.equal(checkName("张伟"), true);
assert.equal(checkName(',,__()'), false);
assert.equal(checkName('<foo>'), false);
assert.equal(checkName('<foo>'), false);
assert.equal(checkName('(bar)'), false);
assert.equal(checkName('foo <baz>'), false);
assert.equal(checkName('-foo'), false);
assert.equal(checkName("'foo"), false);
assert.equal(checkName(' Bob'), false);
assert.equal(checkName('='), false);
assert.equal(checkName('santa='), false);
});
});
});