-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathcellEvents_tooltip_pagination_test.ts
More file actions
52 lines (45 loc) · 1.66 KB
/
cellEvents_tooltip_pagination_test.ts
File metadata and controls
52 lines (45 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import {expect} from 'chai';
import {handleEnter, handleMove} from 'dash-table/handlers/cellEvents';
describe('cell events - tooltip row index with pagination', () => {
it('uses the provided row index when entering a cell', () => {
let state: any;
const propsFn = () =>
({
setState: (next: any) => {
state = next;
},
visibleColumns: [{id: 'Description'}],
virtualized: {
indices: [5, 6, 7, 8, 9],
offset: {rows: 0, columns: 0}
}
} as any);
handleEnter(propsFn, 6, 0);
expect(state.currentTooltip.row).to.equal(6);
expect(state.currentTooltip.id).to.equal('Description');
expect(state.currentTooltip.header).to.equal(false);
});
it('uses the provided row index when moving between cells', () => {
let state: any;
const propsFn = () =>
({
currentTooltip: {
header: false,
id: 'Description',
row: 5
},
setState: (next: any) => {
state = next;
},
visibleColumns: [{id: 'Description'}],
virtualized: {
indices: [5, 6, 7, 8, 9],
offset: {rows: 0, columns: 0}
}
} as any);
handleMove(propsFn, 6, 0);
expect(state.currentTooltip.row).to.equal(6);
expect(state.currentTooltip.id).to.equal('Description');
expect(state.currentTooltip.header).to.equal(false);
});
});