Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created March 18, 2019 23:33
Show Gist options
  • Save ajcrites/dad4684c3f1dee97e540b8fc5046e4ef to your computer and use it in GitHub Desktop.
Save ajcrites/dad4684c3f1dee97e540b8fc5046e4ef to your computer and use it in GitHub Desktop.
import { colorReducer, updateHex } from '../colorReducer';
describe('colorReducer', () => {
test('update color with valid hex', () => {
const initialState = {};
const testHex = '#abcdef';
const newState = colorReducer(initialState, updateHex(testHex));
expect(newState).toEqual({
hex: testHex,
rgba: [171, 205, 239, 1],
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment