-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit test for
User.createPersonalProjectName
- Loading branch information
1 parent
4e3d26e
commit 5ef982b
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
}, | ||
); | ||
}); | ||
}); |