2
2
3
3
import assert from 'assert' ;
4
4
import { IS_PLAYING } from '../../app/actions/isPlaying' ;
5
- import { IS_PAUSED } from '../../app/actions/isPaused' ;
6
5
import { HAS_STOPPED } from '../../app/actions/hasStopped' ;
7
6
import { playbackReducer } from '../../app/reducers/playback' ;
8
7
@@ -12,14 +11,13 @@ describe('playbackState', () => {
12
11
assert . strictEqual ( playbackReducer ( undefined , '' ) . isPlaying , false ) ;
13
12
} ) ;
14
13
15
- it ( '{isPlaying: true, isPaused: false, hasStopped: false} when action.isPlaying is true' , ( ) => {
14
+ it ( '{isPlaying: true, hasStopped: false} when action.isPlaying is true' , ( ) => {
16
15
const state = playbackReducer ( undefined , {
17
16
type : IS_PLAYING ,
18
17
isPlaying : true
19
18
} ) ;
20
19
21
20
assert . strictEqual ( state . isPlaying , true ) ;
22
- assert . strictEqual ( state . isPaused , false ) ;
23
21
assert . strictEqual ( state . hasStopped , false ) ;
24
22
} ) ;
25
23
@@ -33,45 +31,18 @@ describe('playbackState', () => {
33
31
} ) ;
34
32
} ) ;
35
33
36
- describe ( 'isPaused property' , ( ) => {
37
- it ( 'defaults to false' , ( ) => {
38
- assert . strictEqual ( playbackReducer ( undefined , '' ) . isPaused , false ) ;
39
- } ) ;
40
-
41
- it ( '{isPlaying: false, isPaused: true, hasStopped: false} when action.isPaused is true' , ( ) => {
42
- const state = playbackReducer ( undefined , {
43
- type : IS_PAUSED ,
44
- isPaused : true
45
- } ) ;
46
-
47
- assert . strictEqual ( state . isPlaying , false ) ;
48
- assert . strictEqual ( state . isPaused , true ) ;
49
- assert . strictEqual ( state . hasStopped , false ) ;
50
- } ) ;
51
-
52
- it ( '{isPaused: false} when action.isPaused is false' , ( ) => {
53
- const state = playbackReducer ( undefined , {
54
- type : IS_PAUSED ,
55
- isPaused : false
56
- } ) ;
57
-
58
- assert . strictEqual ( state . isPaused , false ) ;
59
- } ) ;
60
- } ) ;
61
-
62
34
describe ( 'hasStopped property' , ( ) => {
63
35
it ( 'defaults to true' , ( ) => {
64
36
assert . strictEqual ( playbackReducer ( undefined , '' ) . hasStopped , true ) ;
65
37
} ) ;
66
38
67
- it ( '{isPlaying: false, isPaused: false, hasStopped: true} when action.hasStopped is true' , ( ) => {
39
+ it ( '{isPlaying: false, hasStopped: true} when action.hasStopped is true' , ( ) => {
68
40
const state = playbackReducer ( undefined , {
69
41
type : HAS_STOPPED ,
70
42
hasStopped : true
71
43
} ) ;
72
44
73
45
assert . strictEqual ( state . isPlaying , false ) ;
74
- assert . strictEqual ( state . isPaused , false ) ;
75
46
assert . strictEqual ( state . hasStopped , true ) ;
76
47
} ) ;
77
48
0 commit comments