]>
Commit | Line | Data |
---|---|---|
26dfa00e RBR |
1 | import { enableTopicActions, disableTopicActions, topicActions } from './actions'; |
2 | ||
3 | describe('Topic actions and state', () => { | |
cac85db0 RBR |
4 | test('There should be no topic actions by default', () => { |
5 | topicActions.subscribe((actions) => { | |
6 | expect(actions).toBe(undefined); | |
7 | })(); | |
8 | }); | |
9 | ||
10 | test('enableTopicActions should set the topic id', () => { | |
11 | enableTopicActions('free_hat'); | |
12 | topicActions.subscribe((actions) => { | |
13 | expect(actions).toEqual({ | |
14 | id: 'free_hat' | |
15 | }); | |
16 | })(); | |
17 | }); | |
18 | ||
19 | test('disableTopicActions should unset the topic id', () => { | |
20 | disableTopicActions(); | |
21 | topicActions.subscribe((actions) => { | |
22 | expect(actions).toEqual(undefined); | |
23 | })(); | |
24 | }); | |
26dfa00e | 25 | }); |