All files / components/Button buttonSelectors.js

100% Statements 10/10
100% Branches 4/4
100% Functions 3/3
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19    14x   14x 18x 18x 1x       17x     14x 6x   14x  
import { createSelector } from '../../helpers';
 
export const getButton = createSelector('button');
 
export const getBtnTypeStyle = (theme, btntype, state) => {
  const typeStyle = getButton(theme).btnTypes[btntype];
  if (!typeStyle) {
    throw new Error(
      `There is no ${btntype} button type in the <Button /> theme`
    );
  }
  return typeStyle[state];
};
 
export const getBtnSizingStyle = (theme, sizing) =>
  getButton(theme).sizings[sizing] || {};
 
export const getBtnCommonStyle = theme => getButton(theme).common;