Skip to content

Commit

Permalink
Merge pull request #545 from namespace-ee/develop
Browse files Browse the repository at this point in the history
0.23.1
  • Loading branch information
Ilaiwi authored Apr 4, 2019
2 parents 27fc1bd + 907269c commit 82cd257
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 73 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres (more or less) to [Semantic Versioning](http://semver.o

## Unreleased

## 0.23.1

- fix height calculation of stacked items is off if no item is visible in a line @Felix-N
- fix Unsubscribing markers correctly when unmounted @gaston-niglia

## 0.23.0

- improve unit tests coverage #426 - @ilaiwi
Expand Down
24 changes: 24 additions & 0 deletions __tests__/components/Markers/TimelineMarkers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { render } from 'react-testing-library'
import 'jest-dom/extend-expect'
import TimelineMarkers from 'lib/markers/public/TimelineMarkers'
import TodayMarker from 'lib/markers/public/TodayMarker'
import CustomMarker from 'lib/markers/public/CustomMarker'
import { RenderWrapper } from 'test-utility/marker-renderer'

describe('TimelineMarkers', () => {
Expand All @@ -23,4 +24,27 @@ describe('TimelineMarkers', () => {
</RenderWrapper>
)
})

it('is unsubscribed on unmounting after passing new date then hide it', ()=>{
const defaultCustomMarkerTestId = 'default-customer-marker-id'
const { queryByTestId, rerender } = render(
<RenderWrapper>
<TimelineMarkers>
<CustomMarker date={1000} />
</TimelineMarkers>
</RenderWrapper>)

rerender(<RenderWrapper>
<TimelineMarkers>
<CustomMarker date={2000} />
</TimelineMarkers>
</RenderWrapper>)

rerender(<RenderWrapper>
<TimelineMarkers>
</TimelineMarkers>
</RenderWrapper>)

expect(queryByTestId(defaultCustomMarkerTestId)).not.toBeInTheDocument()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 7.5,
"top": 3.75,
"width": 78.74857638888886,
},
"id": "0",
Expand All @@ -36,7 +36,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 37.5,
"top": 33.75,
"width": 245.4152430555556,
},
"id": "5",
Expand All @@ -54,7 +54,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 7.5,
"top": 3.75,
"width": 287.08190972222224,
},
"id": "6",
Expand All @@ -72,7 +72,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 37.5,
"top": 33.75,
"width": 172.1749884259259,
},
"id": "1",
Expand All @@ -90,7 +90,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 7.5,
"top": 3.75,
"width": 236.08273148148123,
},
"id": "2",
Expand All @@ -108,23 +108,23 @@ Object {
"index": 2,
},
"stack": true,
"top": 105,
"top": 93.75,
"width": 236.08273148148146,
},
"id": "3",
},
],
"groupHeights": Array [
67.5,
60,
30,
30,
37.5,
],
"groupTops": Array [
0,
67.5,
97.5,
60,
90,
],
"height": 135,
"height": 120,
"visibleTimeEnd": 1540634400000,
"visibleTimeStart": 1540548000000,
}
Expand All @@ -148,7 +148,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 7.5,
"top": 3.75,
"width": 75.59863333333351,
},
"id": "0",
Expand All @@ -166,7 +166,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 37.5,
"top": 33.75,
"width": 235.5986333333335,
},
"id": "5",
Expand All @@ -184,7 +184,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 7.5,
"top": 3.75,
"width": 275.5986333333335,
},
"id": "6",
Expand All @@ -202,7 +202,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 37.5,
"top": 33.75,
"width": 165.28798888888878,
},
"id": "1",
Expand All @@ -220,7 +220,7 @@ Object {
"index": 0,
},
"stack": true,
"top": 7.5,
"top": 3.75,
"width": 226.6394222222225,
},
"id": "2",
Expand All @@ -238,23 +238,23 @@ Object {
"index": 2,
},
"stack": true,
"top": 105,
"top": 93.75,
"width": 226.6394222222225,
},
"id": "3",
},
],
"groupHeights": Array [
67.5,
60,
30,
30,
37.5,
],
"groupTops": Array [
0,
67.5,
97.5,
60,
90,
],
"height": 135,
"height": 120,
"visibleTimeEnd": 1540591200000,
"visibleTimeStart": 1540501200000,
}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils/calendar/__snapshots__/group-stack.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ exports[`groupStack works as expected 1`] = `
Object {
"groupHeight": 0,
"itemTop": 7.5,
"verticalMargin": 37.5,
"verticalMargin": 18.75,
}
`;
2 changes: 1 addition & 1 deletion __tests__/utils/calendar/__snapshots__/stack-group.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Object {
exports[`stackGroup should stack list of items 1`] = `
Object {
"groupHeight": 0,
"verticalMargin": 7.5,
"verticalMargin": 3.75,
}
`;
Loading

0 comments on commit 82cd257

Please sign in to comment.