Files
teleport/web/packages/shared/utils/text.test.ts
T
Lisa Kim 3a88c153b5 WebDiscover: Add custom input fields for database test connection with wildcard (#40931)
* WebDiscover: Add custom input fields for database test connection with asterisks

* Add specific validation rule and add tests

* Update database fixture for testing
2024-05-08 00:58:03 +00:00

30 lines
1.1 KiB
TypeScript

/**
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { pluralize, capitalizeFirstLetter } from './text';
test('pluralize: sending in zero number', () => {
expect(pluralize(0, 'apple')).toBe('apple');
expect(pluralize(2, 'apple')).toBe('apples');
});
test('capitalizeFirstLetter', () => {
expect(capitalizeFirstLetter('hello')).toBe('Hello');
expect(capitalizeFirstLetter('')).toBe('');
});