Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// selectors.js
export const selectLogin = (state: AppStateT) => state.login;
export const selectAuthenticated = createSelector(
selectLogin,
(loginState: LoginStateT) => loginState.authenticated
);
// selectors.test.js
import { type } from 'ramda';
import {
selectAuthenticated,
} from '../login.selectors';
describe('Login Selectors', () => {
describe('selectAuthenticated', () => {
it('should return login.authenticated as boolean', () => {
mockParameters = {
login: {
authenticated: false,
authenticating: false,
},
};
const selected = selectAuthenticated.resultFunc(mockParameters.login);
expect(type(selected)).toEqual('Boolean');
});
});
});
@jasonleibowitz

This comment has been minimized.

Copy link

commented Feb 21, 2019

In this example what are the type definitions for AppStateT and LoginStateT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.