Skip to content

Instantly share code, notes, and snippets.

@aloverso
Last active May 7, 2020 20:55
Show Gist options
  • Select an option

  • Save aloverso/a8b3ce64b60dc3e5e83e34a25e3f56b6 to your computer and use it in GitHub Desktop.

Select an option

Save aloverso/a8b3ce64b60dc3e5e83e34a25e3f56b6 to your computer and use it in GitHub Desktop.
it('transforms into a user entity', () => {
const user = buildDefaultUser({});
const expectedUserEntity = {
username: user.name,
password: user.password
};
expect(userTransformer.transform(user)).toEqual(expectedUserEntity);
});
it('assigns default password to entity when user password is empty', () => {
const user = buildDefaultUser({password: ""});
const expectedUserEntity = {
username: user.name,
password: DEFAULT_PASSWORD
}
expect(userTransformer.transform(user)).toEqual(expectedUserEntity);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment