Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d34a94

Browse files
committed
add tests for pagePosition
1 parentea5941b commit5d34a94

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// <reference path="../../../typings/globals/jest/index.d.ts" />
2+
3+
importreducerfrom'./index';
4+
import{PAGE_SET}from'../types';
5+
6+
describe('page position reducer',()=>{
7+
8+
it('does nothing if no known action',()=>{
9+
constaction={type:'unknown'};
10+
expect(reducer(undefined,action)).toBe(0);
11+
});
12+
13+
it('handles PAGE_SET',()=>{
14+
constpagePosition=2;
15+
constaction={type:PAGE_SET,payload:{ pagePosition}};
16+
expect(reducer(0,action)).toBe(pagePosition);
17+
});
18+
19+
it('handles PROGRESS_PAGE_POSITION',()=>{
20+
constprogress={
21+
pages:[true,true,true,false,false]
22+
};
23+
constaction={type:'PROGRESS_PAGE_POSITION',payload:{ progress}};
24+
expect(reducer(0,action)).toBe(3);
25+
});
26+
27+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp