We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
EmployeeType
1 parent 3fa0dfd commit d83fe11Copy full SHA for d83fe11
src/example-02/emplyees/types/index.js
@@ -3,6 +3,10 @@ export class EmployeeType {
3
this.value = value;
4
}
5
6
+ get capitalizedName() {
7
+ return this.toString().charAt(0).toUpperCase() + this.toString().slice(1);
8
+ }
9
+
10
toString() {
11
return this.value;
12
src/example-02/emplyees/types/index.test.js
@@ -5,4 +5,9 @@ describe('EmployeeType', () => {
const employeeType = new EmployeeType('engineer');
expect(employeeType.toString()).toBe('engineer');
});
+ it('should return the capitalized name', () => {
+ const employeeType = new EmployeeType('manager');
+ expect(employeeType.capitalizedName).toBe('Manager');
+ });
13
0 commit comments