@@ -4,43 +4,29 @@ const index = require('../index');
4
4
5
5
jest . mock ( '../timeJump' ) ;
6
6
7
- describe ( 'unit testing for index.js' , ( ) => {
8
- test ( 'index.js should be exporting the linkState and timeJump methods' , ( ) => {
9
- expect ( typeof index . linkState ) . toBe ( 'function' ) ;
10
- expect ( typeof index . timeJump ) . toBe ( 'function' ) ;
11
- } ) ;
12
-
13
- test ( 'index.js should be listening to the window for the jumpToSnap message' , ( done ) => {
14
- const calls = 10 ;
15
- let count = 0 ;
16
- global . addEventListener ( 'message' , ( { data : { action } } ) => {
17
- if ( action === 'jumpToSnap' ) {
18
- count += 1 ;
19
- // timeJump should be called everytime a message is received
20
- expect ( index . timeJump . mock . calls . length ) . toBe ( count ) ;
21
-
22
- // test is done once all messages have been received
23
- if ( count === calls ) done ( ) ;
24
- }
25
- } ) ;
26
-
27
- // iterate ${calls} amount of times
28
- [ ...Array ( calls ) . keys ( ) ] . forEach ( ( ) => global . postMessage ( { action : 'jumpToSnap' , payload : [ 'test' ] } , '*' ) ) ;
29
- } ) ;
30
-
31
- } ) ;
32
-
33
- describe ( 'testing the emptySnapshot button' , ( ) => {
34
- test ( 'emptySnapshot button should delete all newly created snapshots' , ( ) => {
35
- const mockCb = jest . fn ( ) ;
36
-
37
- const snapshots = shallow ( < div > snapshot</ div > )
38
- const parentComponent = shallow ( < snapshots > </ snapshots > < snapshots > < / snapshots > )
39
-
40
- const button = shallow((< Button onClick = { mockCb } > Empty Snapshots</ Button > ));
41
-
42
- button.find('button').simulate('click');
43
-
44
- expect(mockFuncs.length).not.toEqual(1)
45
- } ) ;
46
- } )
7
+
8
+ // describe('unit testing for index.js', () => {
9
+ // test('index.js should be exporting the linkState and timeJump methods', () => {
10
+ // expect(typeof index.linkState).toBe('function');
11
+ // expect(typeof index.timeJump).toBe('function');
12
+ // });
13
+
14
+ // test('index.js should be listening to the window for the jumpToSnap message', (done) => {
15
+ // const calls = 10;
16
+ // let count = 0;
17
+ // global.addEventListener('message', ({ data: { action } }) => {
18
+ // if (action === 'jumpToSnap') {
19
+ // count += 1;
20
+ // // timeJump should be called everytime a message is received
21
+ // expect(index.timeJump.mock.calls.length).toBe(count);
22
+
23
+ // // test is done once all messages have been received
24
+ // if (count === calls) done();
25
+ // }
26
+ // });
27
+
28
+ // // iterate ${calls} amount of times
29
+ // [...Array(calls).keys()].forEach(() => global.postMessage({ action: 'jumpToSnap', payload: ['test'] }, '*'));
30
+ // });
31
+
32
+ // });
0 commit comments