As per the title of the question.
.../selector.js
const makeSelectUserData = () => createSelector(
selectProfile,
(profileState) => profileState.get('userData')
);
.../tests/selectors.test.js
it('should select the current user', () => {
const mockedState = fromJS({
profile: {
userData: {
firstName: "X",
lastName: "Y",
gender: "Male",
email: "a@b.cd",
},
},
});
console.log(userDataSelector(mockedState));
expect(userDataSelector(mockedState)).toEqual(user);
});
console.log ... prints:
Map { "firstName": "X", "lastName": "Y", "gender": "Male", "email": "a@b.cd" }
hence why, but I don't get why other selector where user is a string (for example) just work and the selector returns a string as it should.
Strangely enough, the selector actually behaves correctly, but the test doesn't.