mirror of
https://github.com/directus/directus.git
synced 2026-01-30 06:18:09 -05:00
List group (#173)
* mvp list groups * list group updates * updated readme and list group to use css vars and icons * added supgroups to story * add list group test * Expand Transition / Transitions Folder (#187) * add expand transition to components folder * expand readme * test sorta * test is dumb * dummy component to test * oops * Add tests for capitalize first * Rename v-transition-expand to expand-transition, inline util in test * Update src/components/transitions/expand/expand-methods.ts * Update src/components/transitions/expand/expand-methods.ts * Update src/components/transitions/expand/expand-methods.ts * Rename some more things, add storybook entry * Use expand transition in detail drawer * Improve readme Co-authored-by: rijkvanzanten <rijkvanzanten@me.com> * Refactor out groupable top level component + indentLevel prop * Fix tests * Update readme Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
16
src/utils/capitalize-first/capitalize-first.test.ts
Normal file
16
src/utils/capitalize-first/capitalize-first.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import capitalizeFirst from './capitalize-first';
|
||||
|
||||
describe('Utils / capitalizeFirst', () => {
|
||||
it('Capitalizes the first letter', () => {
|
||||
const testCases = [
|
||||
['test', 'Test'],
|
||||
['directus', 'Directus'],
|
||||
['123', '123'],
|
||||
['_abc', '_abc']
|
||||
];
|
||||
|
||||
for (const testCase of testCases) {
|
||||
expect(capitalizeFirst(testCase[0])).toBe(testCase[1]);
|
||||
}
|
||||
});
|
||||
});
|
||||
3
src/utils/capitalize-first/capitalize-first.ts
Normal file
3
src/utils/capitalize-first/capitalize-first.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function capitalizeFirst(str: string): string {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
}
|
||||
4
src/utils/capitalize-first/index.ts
Normal file
4
src/utils/capitalize-first/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import capitalizeFirst from './capitalize-first';
|
||||
|
||||
export { capitalizeFirst };
|
||||
export default capitalizeFirst;
|
||||
Reference in New Issue
Block a user