Skip to content

Commit

Permalink
add unit test for User.createPersonalProjectName
Browse files Browse the repository at this point in the history
  • Loading branch information
despairblue committed Apr 8, 2024
1 parent 4e3d26e commit 5ef982b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/cli/test/unit/databases/entities/user.entity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,22 @@ describe('User Entity', () => {
);
});
});

describe('createPersonalProjectName', () => {
test.each([
['Nathan', 'Nathaniel', '[email protected]', 'Nathan Nathaniel <[email protected]>'],
[undefined, 'Nathaniel', '[email protected]', '<[email protected]>'],
['Nathan', undefined, '[email protected]', '<[email protected]>'],
[undefined, undefined, '[email protected]', '<[email protected]>'],
[undefined, undefined, undefined, 'Unnamed Project'],
['Nathan', 'Nathaniel', undefined, 'Unnamed Project'],
])(
'given fistName: %s, lastName: %s and email: %s this gives the projectName: "%s"',
async (firstName, lastName, email, projectName) => {
const user = new User();
Object.assign(user, { firstName, lastName, email });
expect(user.createPersonalProjectName()).toBe(projectName);
},
);
});
});

0 comments on commit 5ef982b

Please sign in to comment.