Skip to content

Commit 82cd257

Browse files
authored
Merge pull request namespace-ee#545 from namespace-ee/develop
0.23.1
2 parents 27fc1bd + 907269c commit 82cd257

File tree

9 files changed

+102
-73
lines changed

9 files changed

+102
-73
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres (more or less) to [Semantic Versioning](http://semver.o
77

88
## Unreleased
99

10+
## 0.23.1
11+
12+
- fix height calculation of stacked items is off if no item is visible in a line @Felix-N
13+
- fix Unsubscribing markers correctly when unmounted @gaston-niglia
14+
1015
## 0.23.0
1116

1217
- improve unit tests coverage #426 - @ilaiwi

__tests__/components/Markers/TimelineMarkers.test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { render } from 'react-testing-library'
33
import 'jest-dom/extend-expect'
44
import TimelineMarkers from 'lib/markers/public/TimelineMarkers'
55
import TodayMarker from 'lib/markers/public/TodayMarker'
6+
import CustomMarker from 'lib/markers/public/CustomMarker'
67
import { RenderWrapper } from 'test-utility/marker-renderer'
78

89
describe('TimelineMarkers', () => {
@@ -23,4 +24,27 @@ describe('TimelineMarkers', () => {
2324
</RenderWrapper>
2425
)
2526
})
27+
28+
it('is unsubscribed on unmounting after passing new date then hide it', ()=>{
29+
const defaultCustomMarkerTestId = 'default-customer-marker-id'
30+
const { queryByTestId, rerender } = render(
31+
<RenderWrapper>
32+
<TimelineMarkers>
33+
<CustomMarker date={1000} />
34+
</TimelineMarkers>
35+
</RenderWrapper>)
36+
37+
rerender(<RenderWrapper>
38+
<TimelineMarkers>
39+
<CustomMarker date={2000} />
40+
</TimelineMarkers>
41+
</RenderWrapper>)
42+
43+
rerender(<RenderWrapper>
44+
<TimelineMarkers>
45+
</TimelineMarkers>
46+
</RenderWrapper>)
47+
48+
expect(queryByTestId(defaultCustomMarkerTestId)).not.toBeInTheDocument()
49+
})
2650
})

__tests__/utils/calendar/__snapshots__/calculate-scroll-canvas.js.snap

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Object {
1818
"index": 0,
1919
},
2020
"stack": true,
21-
"top": 7.5,
21+
"top": 3.75,
2222
"width": 78.74857638888886,
2323
},
2424
"id": "0",
@@ -36,7 +36,7 @@ Object {
3636
"index": 0,
3737
},
3838
"stack": true,
39-
"top": 37.5,
39+
"top": 33.75,
4040
"width": 245.4152430555556,
4141
},
4242
"id": "5",
@@ -54,7 +54,7 @@ Object {
5454
"index": 0,
5555
},
5656
"stack": true,
57-
"top": 7.5,
57+
"top": 3.75,
5858
"width": 287.08190972222224,
5959
},
6060
"id": "6",
@@ -72,7 +72,7 @@ Object {
7272
"index": 0,
7373
},
7474
"stack": true,
75-
"top": 37.5,
75+
"top": 33.75,
7676
"width": 172.1749884259259,
7777
},
7878
"id": "1",
@@ -90,7 +90,7 @@ Object {
9090
"index": 0,
9191
},
9292
"stack": true,
93-
"top": 7.5,
93+
"top": 3.75,
9494
"width": 236.08273148148123,
9595
},
9696
"id": "2",
@@ -108,23 +108,23 @@ Object {
108108
"index": 2,
109109
},
110110
"stack": true,
111-
"top": 105,
111+
"top": 93.75,
112112
"width": 236.08273148148146,
113113
},
114114
"id": "3",
115115
},
116116
],
117117
"groupHeights": Array [
118-
67.5,
118+
60,
119+
30,
119120
30,
120-
37.5,
121121
],
122122
"groupTops": Array [
123123
0,
124-
67.5,
125-
97.5,
124+
60,
125+
90,
126126
],
127-
"height": 135,
127+
"height": 120,
128128
"visibleTimeEnd": 1540634400000,
129129
"visibleTimeStart": 1540548000000,
130130
}
@@ -148,7 +148,7 @@ Object {
148148
"index": 0,
149149
},
150150
"stack": true,
151-
"top": 7.5,
151+
"top": 3.75,
152152
"width": 75.59863333333351,
153153
},
154154
"id": "0",
@@ -166,7 +166,7 @@ Object {
166166
"index": 0,
167167
},
168168
"stack": true,
169-
"top": 37.5,
169+
"top": 33.75,
170170
"width": 235.5986333333335,
171171
},
172172
"id": "5",
@@ -184,7 +184,7 @@ Object {
184184
"index": 0,
185185
},
186186
"stack": true,
187-
"top": 7.5,
187+
"top": 3.75,
188188
"width": 275.5986333333335,
189189
},
190190
"id": "6",
@@ -202,7 +202,7 @@ Object {
202202
"index": 0,
203203
},
204204
"stack": true,
205-
"top": 37.5,
205+
"top": 33.75,
206206
"width": 165.28798888888878,
207207
},
208208
"id": "1",
@@ -220,7 +220,7 @@ Object {
220220
"index": 0,
221221
},
222222
"stack": true,
223-
"top": 7.5,
223+
"top": 3.75,
224224
"width": 226.6394222222225,
225225
},
226226
"id": "2",
@@ -238,23 +238,23 @@ Object {
238238
"index": 2,
239239
},
240240
"stack": true,
241-
"top": 105,
241+
"top": 93.75,
242242
"width": 226.6394222222225,
243243
},
244244
"id": "3",
245245
},
246246
],
247247
"groupHeights": Array [
248-
67.5,
248+
60,
249+
30,
249250
30,
250-
37.5,
251251
],
252252
"groupTops": Array [
253253
0,
254-
67.5,
255-
97.5,
254+
60,
255+
90,
256256
],
257-
"height": 135,
257+
"height": 120,
258258
"visibleTimeEnd": 1540591200000,
259259
"visibleTimeStart": 1540501200000,
260260
}

__tests__/utils/calendar/__snapshots__/group-stack.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ exports[`groupStack works as expected 1`] = `
44
Object {
55
"groupHeight": 0,
66
"itemTop": 7.5,
7-
"verticalMargin": 37.5,
7+
"verticalMargin": 18.75,
88
}
99
`;

__tests__/utils/calendar/__snapshots__/stack-group.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Object {
1010
exports[`stackGroup should stack list of items 1`] = `
1111
Object {
1212
"groupHeight": 0,
13-
"verticalMargin": 7.5,
13+
"verticalMargin": 3.75,
1414
}
1515
`;

0 commit comments

Comments
 (0)