feat: add pipe to upper only the first letter in a string
This commit is contained in:
21
src/app/pipes/upperfirst-pipe.spec.ts
Normal file
21
src/app/pipes/upperfirst-pipe.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { UpperfirstPipe } from './upperfirst-pipe';
|
||||
|
||||
describe('UpperfirstPipe', () => {
|
||||
let pipe: UpperfirstPipe;
|
||||
|
||||
beforeEach(() => {
|
||||
pipe = new UpperfirstPipe();
|
||||
});
|
||||
|
||||
it('create an instance', () => {
|
||||
const pipe = new UpperfirstPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should uppercase only the first letter on a string', () => {
|
||||
const unformattedString = "today is a great day";
|
||||
const expectedString = "Today is a great day";
|
||||
expect(pipe.transform(unformattedString)).toBe(expectedString);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user