Skip to content
Snippets Groups Projects
Commit e9c93d91 authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Updated layout and tests for new store shape

parent eb2e74cd
No related branches found
No related tags found
No related merge requests found
......@@ -37,8 +37,8 @@ const SPARK_LINE_DIM = {
* @return {Object} containing width and height properties.
*/
const layoutSelector = createSelector(
(state) => state.width,
(state) => state.windowWidth,
(state) => state.ui.width,
(state) => state.ui.windowWidth,
tickSelector,
(width, windowWidth, tickDetails) => {
const margin = mediaQuery(USWDS_SITE_MAX_WIDTH) ? MARGIN : MARGIN_SMALL_DEVICE;
......
......@@ -4,6 +4,7 @@ const { format } = require('d3-format');
const { ASPECT_RATIO } = require('./layout');
describe('points module', () => {
let layoutMock = proxyquire('./layout', {
'./domain': {
......@@ -18,8 +19,10 @@ describe('points module', () => {
it('Should return the width and height with the predefined ASPECT_RATIO', () => {
let layout = layoutMock.layoutSelector({
width: 200,
windowWidth: 600
ui: {
width: 200,
windowWidth: 600
}
});
expect(layout.width).toEqual(200);
expect(layout.height).toEqual(200 * ASPECT_RATIO);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment