Completed
Push — master ( 3953e9...fad0bf )
by Alejandro
15s queued 11s
created

test/settings/reducers/settings.test.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 19
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 10
mnd 0
bc 0
fnc 5
dl 0
loc 19
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
1
import reducer, { SET_REAL_TIME_UPDATES, setRealTimeUpdates } from '../../../src/settings/reducers/settings';
2
3
describe('settingsReducer', () => {
4
  const realTimeUpdates = { enabled: true };
5
6
  describe('reducer', () => {
7
    it('returns realTimeUpdates when action is SET_REAL_TIME_UPDATES', () => {
8
      expect(reducer({}, { type: SET_REAL_TIME_UPDATES, realTimeUpdates })).toEqual({ realTimeUpdates });
9
    });
10
  });
11
12
  describe('setRealTimeUpdates', () => {
13
    it.each([[ true ], [ false ]])('updates settings with provided value and then loads updates again', (enabled) => {
0 ignored issues
show
Bug introduced by
The variable it seems to be never declared. If this is a global, consider adding a /** global: it */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
14
      const result = setRealTimeUpdates(enabled);
15
16
      expect(result).toEqual({ type: SET_REAL_TIME_UPDATES, realTimeUpdates: { enabled } });
17
    });
18
  });
19
});
20