bright-components 10.2.7 → 10.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/circle.yml +1 -2
  2. package/deploy.sh +6 -0
  3. package/dist/components/DayPicker/NewDayPicker/index.js +0 -28
  4. package/dist/components/DayPicker/index.js +2 -20
  5. package/dist/components/DayPickerPanel/HeaderDayPickerPanel/index.js +1 -18
  6. package/dist/components/DayPickerPanel/HeaderMonthPanel/index.js +0 -14
  7. package/dist/components/DayPickerPanel/HeaderYearPanel/index.js +2 -15
  8. package/dist/components/DayPickerPanel/Shortcuts/index.js +2 -16
  9. package/dist/components/DayPickerPanel/index.js +2 -74
  10. package/dist/components/EmployeeCard/index.js +1 -14
  11. package/dist/components/EmployeePicker/FilterBar/index.js +1 -28
  12. package/dist/components/EmployeePicker/Group/index.js +1 -41
  13. package/dist/components/FilterRadioGroup/index.js +2 -14
  14. package/dist/components/Form/index.js +4 -47
  15. package/dist/components/Modal/index.js +1 -23
  16. package/dist/components/RadioBlock/index.js +10 -41
  17. package/dist/components/Snackbar/index.js +1 -17
  18. package/dist/components/Time/OverlayBase/index.js +2 -25
  19. package/dist/components/Time/TimePicker/TimeOverlay/index.js +3 -26
  20. package/dist/components/TimePicker/Time/TimeOverlay/index.js +1 -58
  21. package/dist/setupTests.js +0 -7
  22. package/package.json +6 -8
  23. package/src/components/DayPicker/NewDayPicker/index.js +0 -21
  24. package/src/components/DayPicker/index.js +1 -16
  25. package/src/components/DayPicker/test.js +0 -85
  26. package/src/components/DayPickerPanel/HeaderDayPickerPanel/index.js +2 -22
  27. package/src/components/DayPickerPanel/HeaderDayPickerPanel/test.js +0 -34
  28. package/src/components/DayPickerPanel/HeaderMonthPanel/index.js +0 -10
  29. package/src/components/DayPickerPanel/HeaderMonthPanel/test.js +0 -25
  30. package/src/components/DayPickerPanel/HeaderYearPanel/index.js +3 -12
  31. package/src/components/DayPickerPanel/HeaderYearPanel/test.js +0 -17
  32. package/src/components/DayPickerPanel/Shortcuts/index.js +3 -17
  33. package/src/components/DayPickerPanel/Shortcuts/test.js +0 -39
  34. package/src/components/DayPickerPanel/index.js +1 -69
  35. package/src/components/DayPickerPanel/test.js +0 -177
  36. package/src/components/EmployeeCard/index.js +1 -15
  37. package/src/components/EmployeeCard/test.js +0 -20
  38. package/src/components/EmployeePicker/FilterBar/index.js +2 -26
  39. package/src/components/EmployeePicker/FilterBar/test.js +0 -29
  40. package/src/components/EmployeePicker/Group/index.js +1 -42
  41. package/src/components/EmployeePicker/Group/test.js +0 -21
  42. package/src/components/FilterRadioGroup/index.js +2 -14
  43. package/src/components/FilterRadioGroup/test.js +0 -13
  44. package/src/components/Form/index.js +1 -49
  45. package/src/components/Form/test.js +0 -73
  46. package/src/components/Modal/index.js +1 -22
  47. package/src/components/Modal/test.js +9 -9
  48. package/src/components/RadioBlock/index.js +14 -33
  49. package/src/components/RadioBlock/test.js +35 -155
  50. package/src/components/ResponsiveTabs/test.js +49 -86
  51. package/src/components/Snackbar/index.js +1 -16
  52. package/src/components/Time/OverlayBase/index.js +3 -21
  53. package/src/components/Time/OverlayBase/test.js +0 -50
  54. package/src/components/Time/TimePicker/TimeOverlay/index.js +4 -30
  55. package/src/components/Time/TimePicker/TimeOverlay/test.js +0 -24
  56. package/src/components/TimePicker/DayPart/test.js +1 -1
  57. package/src/components/TimePicker/Time/TimeOverlay/index.js +2 -50
  58. package/src/components/TimePicker/Time/TimeOverlay/test.js +1 -220
  59. package/src/index.js +1 -1
  60. package/src/setupTests.js +0 -2
  61. package/dist/components/TimePicker/utils/PickerGA/index.js +0 -24
  62. package/dist/utils/trackForm/index.js +0 -48
  63. package/src/components/TimePicker/utils/PickerGA/index.js +0 -6
  64. package/src/components/TimePicker/utils/PickerGA/test.js +0 -29
  65. package/src/utils/trackForm/index.js +0 -36
  66. package/src/utils/trackForm/test.js +0 -110
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bright-components",
3
- "version": "10.2.7",
3
+ "version": "10.2.9",
4
4
  "private": false,
5
5
  "main": "./dist",
6
6
  "repository": {
@@ -29,7 +29,6 @@
29
29
  "react-autosuggest": "^9.4.3",
30
30
  "react-copy-to-clipboard": "^5.0.1",
31
31
  "react-day-picker": "^7.3.2",
32
- "react-dev-utils": "^9.0.3",
33
32
  "react-dropzone": "^4.3.0",
34
33
  "react-icon-base": "^2.1.1",
35
34
  "react-onclickoutside": "^6.7.1",
@@ -42,7 +41,6 @@
42
41
  "formik": ">=1.5.x",
43
42
  "react": ">=16",
44
43
  "react-dom": ">=16",
45
- "react-ga": ">=2",
46
44
  "styled-components": ">=4.x"
47
45
  },
48
46
  "scripts": {
@@ -125,8 +123,8 @@
125
123
  "prettier": "^1.18.2",
126
124
  "react": "^16.9.0",
127
125
  "react-app-polyfill": "^1.0.2",
126
+ "react-dev-utils": "^9.0.3",
128
127
  "react-dom": "^16.9.0",
129
- "react-ga": "^2.6.0",
130
128
  "react-styleguidist": "^8.0.6",
131
129
  "resolve": "1.13.1",
132
130
  "resolve-url-loader": "3.1.0",
@@ -200,10 +198,10 @@
200
198
  ],
201
199
  "coverageThreshold": {
202
200
  "global": {
203
- "branches": 100,
204
- "functions": 100,
205
- "lines": 100,
206
- "statements": 100
201
+ "branches": 95,
202
+ "functions": 95,
203
+ "lines": 95,
204
+ "statements": 95
207
205
  }
208
206
  },
209
207
  "snapshotSerializers": [
@@ -7,7 +7,6 @@ import { string, func, bool, shape, instanceOf, number } from 'prop-types';
7
7
  import colors from 'constants/colors';
8
8
  import spacing from 'constants/spacing';
9
9
  import CalendarIcon from 'components/Icons/Calendar/';
10
- import { event } from 'react-ga';
11
10
 
12
11
  const HiddenBox = styled(Input.withComponent('div'))`
13
12
  display: flex;
@@ -62,8 +61,6 @@ const NewDisplay = ({
62
61
  disabled,
63
62
  error,
64
63
  toggleDayPicker,
65
- GA: { category, actionId },
66
- recordValue,
67
64
  dayPickerOpen
68
65
  }) => {
69
66
  const { placeholderDate, dateFormat } = formats[locale] || formats.default;
@@ -120,19 +117,6 @@ const NewDisplay = ({
120
117
  : null;
121
118
  }
122
119
 
123
- if (category) {
124
- const label = `${format(
125
- newDate.from,
126
- 'EEE dd MMM'
127
- )} ${format(newDate.from, 'yyyy')}`;
128
-
129
- event({
130
- category,
131
- action: `${actionId} - Set via Typing`,
132
- ...(recordValue ? { label } : {})
133
- });
134
- }
135
-
136
120
  return onSelectedDate(newDate);
137
121
  }}
138
122
  onChange={({ target: { value } }) => {
@@ -197,11 +181,6 @@ NewDisplay.propTypes = {
197
181
  disabled: bool.isRequired,
198
182
  error: bool.isRequired,
199
183
  toggleDayPicker: func.isRequired,
200
- GA: shape({
201
- category: string,
202
- actionId: string
203
- }).isRequired,
204
- recordValue: bool.isRequired,
205
184
  dayPickerOpen: bool.isRequired
206
185
  };
207
186
 
@@ -4,7 +4,6 @@ import React from 'react';
4
4
  import autobind from 'react-autobind';
5
5
  import onClickOutside from 'react-onclickoutside';
6
6
  import { startOfToday, isSameYear, format, subYears, addYears } from 'date-fns';
7
- import { event } from 'react-ga';
8
7
  import {
9
8
  bool,
10
9
  func,
@@ -181,17 +180,10 @@ class DayPicker extends React.Component {
181
180
  }
182
181
 
183
182
  toggleDayPicker() {
184
- const { disabled, GA } = this.props;
183
+ const { disabled } = this.props;
185
184
  const { dayPickerOpen } = this.state;
186
185
  if (disabled) return;
187
186
 
188
- if (GA.category && !dayPickerOpen) {
189
- event({
190
- category: GA.category,
191
- action: `${GA.actionId} - DayPicker Input Open`
192
- });
193
- }
194
-
195
187
  this.setState({ dayPickerOpen: !dayPickerOpen }, () => {
196
188
  if (this.containerRef.current) {
197
189
  this.containerRef.current.scrollIntoView({
@@ -227,7 +219,6 @@ class DayPicker extends React.Component {
227
219
  disabled,
228
220
  shortcuts,
229
221
  disabledDays,
230
- GA,
231
222
  recordValue,
232
223
  legacyInputStyle,
233
224
  closeButton,
@@ -281,7 +272,6 @@ class DayPicker extends React.Component {
281
272
  disabled={disabled}
282
273
  error={error}
283
274
  toggleDayPicker={this.toggleDayPicker}
284
- GA={GA}
285
275
  recordValue={recordValue}
286
276
  dayPickerOpen={dayPickerOpen}
287
277
  />
@@ -303,7 +293,6 @@ class DayPicker extends React.Component {
303
293
  range={range}
304
294
  onApply={this.applyDate}
305
295
  recordValue={recordValue}
306
- GA={GA}
307
296
  onClear={allowClear ? this.clearValue : undefined}
308
297
  shortcuts={shortcuts}
309
298
  disabledDays={disabledDays}
@@ -333,10 +322,6 @@ DayPicker.propTypes = {
333
322
  style: object, // eslint-disable-line react/forbid-prop-types
334
323
  open: bool,
335
324
  recordValue: bool,
336
- GA: shape({
337
- category: string,
338
- actionId: string
339
- }).isRequired,
340
325
  range: shape({
341
326
  from: instanceOf(Date),
342
327
  to: instanceOf(Date)
@@ -1,11 +1,8 @@
1
1
  import React from 'react';
2
2
  import { render, fireEvent, wait } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
- import ReactGA from 'react-ga';
5
4
  import DayPicker from '.';
6
5
 
7
- jest.mock('react-ga');
8
-
9
6
  describe('<DayPicker />', () => {
10
7
  let wrapper;
11
8
  let onMockSelectedDate;
@@ -19,10 +16,6 @@ describe('<DayPicker />', () => {
19
16
  props = {
20
17
  range: { from: undefined, to: undefined },
21
18
  onSelectedDate: onMockSelectedDate,
22
- GA: {
23
- category: 'Test',
24
- actionId: 'ActionID'
25
- },
26
19
  dateRange: true
27
20
  };
28
21
  wrapper = render(<DayPicker {...props} />);
@@ -360,54 +353,6 @@ describe('<DayPicker />', () => {
360
353
  );
361
354
  });
362
355
 
363
- describe('GA Tags', () => {
364
- it('should call the correct GA tags when the input is selected', () => {
365
- expect(ReactGA.event).not.toHaveBeenCalled();
366
- const inputSelect = wrapper.getByText('Select date');
367
-
368
- fireEvent.click(inputSelect);
369
- expect(ReactGA.event).toHaveBeenCalledWith({
370
- action: 'ActionID - DayPicker Input Open',
371
- category: 'Test'
372
- });
373
- });
374
- it('should call the correct GA tags when the apply button is clicked', () => {
375
- props.range = {
376
- from: new Date('2019-08-01'),
377
- to: new Date('2019-08-30')
378
- };
379
-
380
- wrapper.rerender(<DayPicker {...props} />);
381
- const inputSelect = wrapper.getByText(
382
- 'Thu 01 Aug - Fri 30 Aug 2019'
383
- );
384
- fireEvent.click(inputSelect);
385
- expect(ReactGA.event).toHaveBeenCalledTimes(1);
386
-
387
- const startDate = wrapper.getByLabelText(date1);
388
- const endDate = wrapper.getByLabelText(date2);
389
-
390
- fireEvent.click(startDate);
391
- fireEvent.click(endDate);
392
-
393
- const applyBtn = wrapper.getByText('Apply');
394
- fireEvent.click(applyBtn);
395
-
396
- expect(ReactGA.event).toHaveBeenCalledWith({
397
- action: 'ActionID - Apply',
398
- category: 'Test'
399
- });
400
- });
401
-
402
- it('should only fire GA if input box is clicked to open and not clicked to close', () => {
403
- const inputSelect = wrapper.getByText('Select date');
404
- fireEvent.click(inputSelect);
405
- fireEvent.click(inputSelect);
406
-
407
- expect(ReactGA.event).toHaveBeenCalledTimes(1);
408
- });
409
- });
410
-
411
356
  describe('Typing date', () => {
412
357
  it('should set the correct date when typed in', async () => {
413
358
  wrapper.rerender(
@@ -671,35 +616,5 @@ describe('<DayPicker />', () => {
671
616
  const inputSelect = wrapper.getByTestId('new input');
672
617
  expect(inputSelect).toBeDisabled();
673
618
  });
674
-
675
- it('should call the correct GA tags when the date is typed', async () => {
676
- wrapper.rerender(
677
- <DayPicker
678
- {...props}
679
- typeable
680
- dateRange={false}
681
- range={{
682
- from: undefined,
683
- to: undefined
684
- }}
685
- recordValue
686
- />
687
- );
688
- expect(ReactGA.event).toHaveBeenCalledTimes(0);
689
-
690
- const inputSelect = wrapper.getByTestId('new input');
691
- fireEvent.focus(inputSelect);
692
- userEvent.type(inputSelect, `201222`);
693
- await wait(() => expect(inputSelect.value).toEqual('20/12/22'));
694
- fireEvent.blur(inputSelect);
695
-
696
- await wait(() =>
697
- expect(ReactGA.event).toHaveBeenCalledWith({
698
- action: 'ActionID - Set via Typing',
699
- category: 'Test',
700
- label: 'Tue 20 Dec 2022'
701
- })
702
- );
703
- });
704
619
  });
705
620
  });
@@ -21,8 +21,6 @@ import {
21
21
  startOfDay,
22
22
  startOfMonth
23
23
  } from 'date-fns';
24
-
25
- import { event } from 'react-ga';
26
24
  import {
27
25
  bool,
28
26
  func,
@@ -30,8 +28,7 @@ import {
30
28
  number,
31
29
  shape,
32
30
  array,
33
- oneOf,
34
- string
31
+ oneOf
35
32
  } from 'prop-types';
36
33
  import styled from 'styled-components';
37
34
  import autoBind from 'react-autobind';
@@ -250,7 +247,6 @@ class HeaderDayPickerPanel extends React.Component {
250
247
  onMonthClick,
251
248
  onYearClick,
252
249
  shortcuts,
253
- GA,
254
250
  isDateSelect,
255
251
  onMonthChange,
256
252
  onYearChange
@@ -311,18 +307,10 @@ class HeaderDayPickerPanel extends React.Component {
311
307
  onNext={() => {
312
308
  onNextClick();
313
309
  this.setMonthYear(nextMonth);
314
- event({
315
- category: GA.category,
316
- action: `${GA.actionId} - Next Month`
317
- });
318
310
  }}
319
311
  onPrevious={() => {
320
312
  onPreviousClick();
321
313
  this.setMonthYear(previousMonth);
322
- event({
323
- category: GA.category,
324
- action: `${GA.actionId} - Previous Month`
325
- });
326
314
  }}
327
315
  showNext={showNext}
328
316
  showPrevious={showPrevious}
@@ -405,17 +393,13 @@ class HeaderDayPickerPanel extends React.Component {
405
393
  set={shortcuts}
406
394
  dateRange={dateRange}
407
395
  shortcutClicked={this.setDateFromShortcut}
408
- GA={GA}
409
396
  />
410
397
  )}
411
398
  </FooterShortcuts>
412
399
  {(dateRange || onClear) && (
413
400
  <FooterActions>
414
401
  {onClear && (
415
- <ClearButton
416
- gaAction={`${GA.actionId} Day picker clear`}
417
- onClick={onClear}
418
- >
402
+ <ClearButton onClick={onClear}>
419
403
  Clear
420
404
  </ClearButton>
421
405
  )}
@@ -455,10 +439,6 @@ HeaderDayPickerPanel.propTypes = {
455
439
  onClear: func,
456
440
  disabledDays: array, // eslint-disable-line react/forbid-prop-types
457
441
  shortcuts: oneOf(['today', 'current', 'last']),
458
- GA: shape({
459
- category: string,
460
- actionId: string
461
- }).isRequired,
462
442
  isDateSelect: bool,
463
443
  onMonthChange: func,
464
444
  onYearChange: func
@@ -17,12 +17,7 @@ import {
17
17
  getDate,
18
18
  getDaysInMonth
19
19
  } from 'date-fns';
20
-
21
- import { event } from 'react-ga';
22
20
  import HeaderDayPickerPanel from '.';
23
- import Header from '../Header';
24
-
25
- jest.mock('react-ga');
26
21
 
27
22
  let comp;
28
23
 
@@ -59,39 +54,10 @@ describe('Calendar view', () => {
59
54
  startDateClicked={false}
60
55
  shortcuts="current"
61
56
  range={{ from: new Date(2018, 3, 1), to: new Date(2018, 3, 7) }}
62
- GA={{
63
- category: 'Cat',
64
- actionId: 'Action ID'
65
- }}
66
57
  />
67
58
  );
68
59
  });
69
60
 
70
- describe('GA Event tracking', () => {
71
- it('should be passed a GA prop with an object and it should be passed to Shortcuts', () => {
72
- expect(comp.find('Shortcuts').prop('GA')).toEqual({
73
- category: 'Cat',
74
- actionId: 'Action ID'
75
- });
76
- });
77
-
78
- it('should fire a GA event, when next or previous is clicked', () => {
79
- comp.find(Header).prop('onNext')();
80
-
81
- expect(event).toHaveBeenCalledWith({
82
- category: 'Cat',
83
- action: 'Action ID - Next Month'
84
- });
85
-
86
- comp.find(Header).prop('onPrevious')();
87
-
88
- expect(event).toHaveBeenCalledWith({
89
- category: 'Cat',
90
- action: 'Action ID - Previous Month'
91
- });
92
- });
93
- });
94
-
95
61
  describe('Day Picker with Previous and Next', () => {
96
62
  it('should render the Header and DayPicker component', () => {
97
63
  expect(comp.find('Header')).toHaveLength(1);
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { func, number, shape, string, oneOfType, bool } from 'prop-types';
3
3
  import { format, startOfMonth } from 'date-fns';
4
- import { event } from 'react-ga';
5
4
  import styled from 'styled-components';
6
5
  import spacing from 'constants/spacing';
7
6
  import Header from '../Header';
@@ -27,7 +26,6 @@ const HeaderMonthPanel = props => {
27
26
  setYear,
28
27
  switchBackToCalendarView,
29
28
  onCancelClick,
30
- GA: { category, actionId },
31
29
  isViewingCurrentYear,
32
30
  isMonthOnly
33
31
  } = props;
@@ -54,10 +52,6 @@ const HeaderMonthPanel = props => {
54
52
  const selectedIndex = MONTHS.indexOf(selectedMonth);
55
53
  setMonth(selectedIndex);
56
54
  switchBackToCalendarView();
57
- event({
58
- category,
59
- action: `${actionId} - Month ${selectedIndex + 1}`
60
- });
61
55
  }}
62
56
  selectedItem={defaultSelectedItem}
63
57
  hideSelected={!isViewingCurrentYear}
@@ -86,10 +80,6 @@ HeaderMonthPanel.propTypes = {
86
80
  setYear: func.isRequired,
87
81
  switchBackToCalendarView: func.isRequired,
88
82
  onCancelClick: func,
89
- GA: shape({
90
- category: string,
91
- actionId: string
92
- }).isRequired,
93
83
  isViewingCurrentYear: bool,
94
84
  isMonthOnly: bool
95
85
  };
@@ -1,10 +1,7 @@
1
1
  import React from 'react';
2
2
  import { mount } from 'enzyme';
3
- import { event } from 'react-ga';
4
3
  import HeaderMonthPanel from '.';
5
4
 
6
- jest.mock('react-ga');
7
-
8
5
  describe('Month and Header wrapper', () => {
9
6
  const mockSetMonth = jest.fn();
10
7
  const mockSetYear = jest.fn();
@@ -25,10 +22,6 @@ describe('Month and Header wrapper', () => {
25
22
  )}
26
23
  switchBackToCalendarView={mockSwitchBackToCalendarView}
27
24
  onCancelClick={mockCancelClick}
28
- GA={{
29
- category: 'Cat',
30
- actionId: 'Action ID'
31
- }}
32
25
  />
33
26
  );
34
27
  });
@@ -63,16 +56,6 @@ describe('Month and Header wrapper', () => {
63
56
  expect(mockSetMonth).toHaveBeenCalledWith(2);
64
57
  });
65
58
 
66
- it('should fire a GA event displaying the Month selected', () => {
67
- comp.find('button')
68
- .at(2)
69
- .simulate('click');
70
-
71
- expect(event).toHaveBeenCalledWith({
72
- category: 'Cat',
73
- action: 'Action ID - Month 3'
74
- });
75
- });
76
59
  it('should call the switchBackToCalendarView function when clicked', () => {
77
60
  expect(mockSwitchBackToCalendarView).not.toHaveBeenCalled();
78
61
  comp.find('button')
@@ -102,10 +85,6 @@ describe('Month and Header wrapper', () => {
102
85
  )}
103
86
  switchBackToCalendarView={mockSwitchBackToCalendarView}
104
87
  onCancelClick={mockCancelClick}
105
- GA={{
106
- category: 'Cat',
107
- actionId: 'Action ID'
108
- }}
109
88
  isMonthOnly
110
89
  />
111
90
  );
@@ -125,10 +104,6 @@ describe('Month and Header wrapper', () => {
125
104
  comp.setProps({ year })
126
105
  )}
127
106
  onCancelClick={mockCancelClick}
128
- GA={{
129
- category: 'Cat',
130
- actionId: 'Action ID'
131
- }}
132
107
  isViewingCurrentYear={false}
133
108
  switchBackToCalendarView={mockSwitchBackToCalendarView}
134
109
  />
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { func, number, arrayOf, string, shape } from 'prop-types';
3
- import { event } from 'react-ga';
2
+ import { func, number, arrayOf } from 'prop-types';
4
3
  import styled from 'styled-components';
5
4
  import spacing from 'constants/spacing';
6
5
  import Header from '../Header';
@@ -25,8 +24,7 @@ const HeaderYearPanel = ({
25
24
  setYear,
26
25
  switchBackToCalendarView,
27
26
  year,
28
- onCancelClick,
29
- GA: { category, actionId }
27
+ onCancelClick
30
28
  }) => {
31
29
  const currentYearItems = yearRanges[yearRangeIndex];
32
30
  const showNext = yearRangeIndex !== yearRanges.length - 1;
@@ -48,10 +46,6 @@ const HeaderYearPanel = ({
48
46
  onItemSelected={yearSelected => {
49
47
  setYear(yearSelected);
50
48
  switchBackToCalendarView();
51
- event({
52
- category,
53
- action: `${actionId} - Year ${yearSelected}`
54
- });
55
49
  }}
56
50
  items={currentYearItems}
57
51
  />
@@ -72,10 +66,7 @@ HeaderYearPanel.propTypes = {
72
66
  onCancelClick: func,
73
67
  yearRanges: arrayOf(arrayOf(number)).isRequired,
74
68
  yearRangeIndex: number.isRequired,
75
- setYearRangeIndex: func.isRequired,
76
- GA: shape({
77
- category: string
78
- }).isRequired
69
+ setYearRangeIndex: func.isRequired
79
70
  };
80
71
 
81
72
  HeaderYearPanel.defaultProps = {
@@ -1,13 +1,11 @@
1
1
  import React from 'react';
2
2
  import { mount } from 'enzyme';
3
- import { event } from 'react-ga';
4
3
  import range from 'utils/range/';
5
4
  import HeaderYearPanel from '.';
6
5
 
7
6
  const mockSetYear = jest.fn();
8
7
  const mockCancelClick = jest.fn();
9
8
  const mockSwitchBackToCalendarView = jest.fn();
10
- jest.mock('react-ga');
11
9
  let comp;
12
10
 
13
11
  describe('Month and Year wrapper', () => {
@@ -23,10 +21,6 @@ describe('Month and Year wrapper', () => {
23
21
  setYear={mockSetYear}
24
22
  onCancelClick={mockCancelClick}
25
23
  switchBackToCalendarView={mockSwitchBackToCalendarView}
26
- GA={{
27
- category: 'Cat',
28
- actionId: 'Action ID'
29
- }}
30
24
  />
31
25
  );
32
26
  });
@@ -107,17 +101,6 @@ describe('Month and Year wrapper', () => {
107
101
  expect(mockSetYear).toHaveBeenCalledWith(2018);
108
102
  });
109
103
 
110
- it('should fire a GA event displaying the Month selected', () => {
111
- comp.find('button')
112
- .at(3)
113
- .simulate('click');
114
-
115
- expect(event).toHaveBeenCalledWith({
116
- category: 'Cat',
117
- action: 'Action ID - Year 2018'
118
- });
119
- });
120
-
121
104
  it('should call the mockSwitchBackToCalendarView method when clicked', () => {
122
105
  expect(mockSwitchBackToCalendarView).not.toHaveBeenCalled();
123
106
  comp.find('button')
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { bool, func, oneOf, shape, string } from 'prop-types';
2
+ import { bool, func, oneOf } from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import { event } from 'react-ga';
5
4
  import {
6
5
  startOfToday,
7
6
  startOfWeek,
@@ -72,21 +71,12 @@ const shortcuts = (set, dateRange) => {
72
71
  return result;
73
72
  };
74
73
 
75
- const Shortcuts = ({
76
- set,
77
- dateRange,
78
- shortcutClicked,
79
- GA: { category, actionId }
80
- }) => (
74
+ const Shortcuts = ({ set, dateRange, shortcutClicked }) => (
81
75
  <>
82
76
  {shortcuts(set, dateRange).map(({ name, range }) => (
83
77
  <Shortcut
84
78
  key={name}
85
79
  onClick={() => {
86
- event({
87
- category,
88
- action: `${actionId} - ${name} shortcut`
89
- });
90
80
  shortcutClicked(range);
91
81
  }}
92
82
  >
@@ -100,11 +90,7 @@ Shortcuts.displayName = 'Shortcuts';
100
90
  Shortcuts.propTypes = {
101
91
  set: oneOf(['today', 'current', 'last', 'next']),
102
92
  dateRange: bool,
103
- shortcutClicked: func.isRequired,
104
- GA: shape({
105
- category: string,
106
- action: string
107
- }).isRequired
93
+ shortcutClicked: func.isRequired
108
94
  };
109
95
 
110
96
  Shortcuts.defaultProps = {