]> git.r.bdr.sh - rbdr/forum/blob - src/lib/stores/actions.test.ts
Don't remember what this WIP was about
[rbdr/forum] / src / lib / stores / actions.test.ts
1 import { enableTopicActions, disableTopicActions, topicActions } from './actions';
2
3 describe('Topic actions and state', () => {
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 });
25 });