mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 17:28:51 -03:30
158 paginated data list (#180)
* working: rename OrganizationTeamsList to PaginatedDataList * convert org notifications list fully to PaginatedDataList * update NotificationList tests * refactor org access to use PaginatedDataList * update tests for org access refactor; fix pagination & sorting * restore Add Role functionality to Org roles * fix displayed text when list of items is empty * preserve query params when navigating through pagination * fix bugs after RBAC rebase * fix lint errors, fix add org access button
This commit is contained in:
34
__tests__/util/strings.test.js
Normal file
34
__tests__/util/strings.test.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { pluralize, getArticle, ucFirst } from '../../src/util/strings';
|
||||
|
||||
describe('string utils', () => {
|
||||
describe('pluralize', () => {
|
||||
test('should add an "s"', () => {
|
||||
expect(pluralize('team')).toEqual('teams');
|
||||
});
|
||||
|
||||
test('should add an "es"', () => {
|
||||
expect(pluralize('class')).toEqual('classes');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getArticle', () => {
|
||||
test('should return "a"', () => {
|
||||
expect(getArticle('team')).toEqual('a');
|
||||
expect(getArticle('notification')).toEqual('a');
|
||||
});
|
||||
|
||||
test('should return "an"', () => {
|
||||
expect(getArticle('aardvark')).toEqual('an');
|
||||
expect(getArticle('ear')).toEqual('an');
|
||||
expect(getArticle('interest')).toEqual('an');
|
||||
expect(getArticle('ogre')).toEqual('an');
|
||||
expect(getArticle('umbrella')).toEqual('an');
|
||||
});
|
||||
});
|
||||
|
||||
describe('ucFirst', () => {
|
||||
test('should capitalize first character', () => {
|
||||
expect(ucFirst('team')).toEqual('Team');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user