This repository was archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 819
Convert enzyme to rtl: BeaconMarker #9840
Merged
Merged
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ae51af9
convert to rtl
a5366d1
correct typo
75dcf7a
update snapshots
67b3cbd
fix TS errors
fd1de7d
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
ad2949c
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
artcodespace 95fd257
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
artcodespace de1deac
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
artcodespace ecace67
use mockMarker approach, add screen tests
fb52da8
TS strict fixes
b65ff70
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
1e23c7f
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
artcodespace d1186e8
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
artcodespace e4b82c2
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
artcodespace 4f0c42d
Merge branch 'develop' into alunturner/enzyme-to-rtl-beacon-marker
artcodespace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
266 changes: 32 additions & 234 deletions
266
test/components/views/beacon/__snapshots__/BeaconMarker-test.tsx.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,240 +1,38 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<BeaconMarker /> renders marker when beacon has location 1`] = ` | ||
<BeaconMarker | ||
beacon={ | ||
Beacon { | ||
"_beaconInfo": { | ||
"assetType": "m.self", | ||
"description": undefined, | ||
"live": true, | ||
"timeout": 3600000, | ||
"timestamp": 1647270879403, | ||
}, | ||
"_events": { | ||
"Beacon.Destroy": [ | ||
[Function], | ||
[Function], | ||
], | ||
"Beacon.LivenessChange": [ | ||
[Function], | ||
[Function], | ||
], | ||
"Beacon.LocationUpdate": [Function], | ||
"Beacon.new": [Function], | ||
"Beacon.update": [Function], | ||
}, | ||
"_eventsCount": 5, | ||
"_isLive": true, | ||
"_latestLocationEvent": { | ||
"content": { | ||
"m.relates_to": { | ||
"event_id": "$alice-room1-1", | ||
"rel_type": "m.reference", | ||
}, | ||
"org.matrix.msc3488.location": { | ||
"description": undefined, | ||
"uri": "geo:51,41", | ||
}, | ||
"org.matrix.msc3488.ts": 1647270879404, | ||
}, | ||
"room_id": undefined, | ||
"sender": "@alice:server", | ||
"type": "org.matrix.msc3672.beacon", | ||
}, | ||
"_maxListeners": undefined, | ||
"clearLatestLocation": [Function], | ||
"livenessWatchTimeout": undefined, | ||
"roomId": "!room:server", | ||
"rootEvent": { | ||
"content": { | ||
"description": undefined, | ||
"live": true, | ||
"org.matrix.msc3488.asset": { | ||
"type": "m.self", | ||
}, | ||
"org.matrix.msc3488.ts": 1647270879403, | ||
"timeout": 3600000, | ||
}, | ||
"event_id": "$alice-room1-1", | ||
"origin_server_ts": 1647270879403, | ||
"room_id": "!room:server", | ||
"sender": "@alice:server", | ||
"state_key": "@alice:server", | ||
"type": "org.matrix.msc3672.beacon_info", | ||
}, | ||
Symbol(kCapture): false, | ||
} | ||
} | ||
map={ | ||
MockMap { | ||
"_events": {}, | ||
"_eventsCount": 0, | ||
"_maxListeners": undefined, | ||
"addControl": [MockFunction], | ||
"fitBounds": [MockFunction], | ||
"removeControl": [MockFunction], | ||
"setCenter": [MockFunction], | ||
"setStyle": [MockFunction], | ||
"zoomIn": [MockFunction], | ||
"zoomOut": [MockFunction], | ||
Symbol(kCapture): false, | ||
} | ||
} | ||
> | ||
<SmartMarker | ||
geoUri="geo:51,41" | ||
id="!room:server_@alice:server" | ||
map={ | ||
MockMap { | ||
"_events": {}, | ||
"_eventsCount": 0, | ||
"_maxListeners": undefined, | ||
"addControl": [MockFunction], | ||
"fitBounds": [MockFunction], | ||
"removeControl": [MockFunction], | ||
"setCenter": [MockFunction], | ||
"setStyle": [MockFunction], | ||
"zoomIn": [MockFunction], | ||
"zoomOut": [MockFunction], | ||
Symbol(kCapture): false, | ||
} | ||
} | ||
roomMember={ | ||
RoomMember { | ||
"_events": {}, | ||
"_eventsCount": 0, | ||
"_isOutOfBand": false, | ||
"_maxListeners": undefined, | ||
"disambiguate": false, | ||
"events": {}, | ||
"membership": undefined, | ||
"modified": 1647270879403, | ||
"name": "@alice:server", | ||
"powerLevel": 0, | ||
"powerLevelNorm": 0, | ||
"rawDisplayName": "@alice:server", | ||
"requestedProfileInfo": false, | ||
"roomId": "!room:server", | ||
"typing": false, | ||
"user": undefined, | ||
"userId": "@alice:server", | ||
Symbol(kCapture): false, | ||
} | ||
} | ||
useMemberColor={true} | ||
> | ||
<span> | ||
<ForwardRef | ||
id="!room:server_@alice:server" | ||
roomMember={ | ||
RoomMember { | ||
"_events": {}, | ||
"_eventsCount": 0, | ||
"_isOutOfBand": false, | ||
"_maxListeners": undefined, | ||
"disambiguate": false, | ||
"events": {}, | ||
"membership": undefined, | ||
"modified": 1647270879403, | ||
"name": "@alice:server", | ||
"powerLevel": 0, | ||
"powerLevelNorm": 0, | ||
"rawDisplayName": "@alice:server", | ||
"requestedProfileInfo": false, | ||
"roomId": "!room:server", | ||
"typing": false, | ||
"user": undefined, | ||
"userId": "@alice:server", | ||
Symbol(kCapture): false, | ||
} | ||
} | ||
useMemberColor={true} | ||
<DocumentFragment> | ||
<span> | ||
<div | ||
class="mx_Marker mx_Username_color4" | ||
id="!room:server_@alice:server" | ||
> | ||
<div | ||
class="mx_Marker_border" | ||
> | ||
<div | ||
className="mx_Marker mx_Username_color4" | ||
id="!room:server_@alice:server" | ||
<span | ||
class="mx_BaseAvatar" | ||
role="presentation" | ||
> | ||
<OptionalTooltip> | ||
<div | ||
className="mx_Marker_border" | ||
> | ||
<MemberAvatar | ||
height={36} | ||
hideTitle={false} | ||
member={ | ||
RoomMember { | ||
"_events": {}, | ||
"_eventsCount": 0, | ||
"_isOutOfBand": false, | ||
"_maxListeners": undefined, | ||
"disambiguate": false, | ||
"events": {}, | ||
"membership": undefined, | ||
"modified": 1647270879403, | ||
"name": "@alice:server", | ||
"powerLevel": 0, | ||
"powerLevelNorm": 0, | ||
"rawDisplayName": "@alice:server", | ||
"requestedProfileInfo": false, | ||
"roomId": "!room:server", | ||
"typing": false, | ||
"user": undefined, | ||
"userId": "@alice:server", | ||
Symbol(kCapture): false, | ||
} | ||
} | ||
viewUserOnClick={false} | ||
width={36} | ||
> | ||
<BaseAvatar | ||
height={36} | ||
idName="@alice:server" | ||
name="@alice:server" | ||
resizeMethod="crop" | ||
title="@alice:server" | ||
width={36} | ||
> | ||
<span | ||
className="mx_BaseAvatar" | ||
role="presentation" | ||
> | ||
<span | ||
aria-hidden="true" | ||
className="mx_BaseAvatar_initial" | ||
style={ | ||
{ | ||
"fontSize": "23.400000000000002px", | ||
"lineHeight": "36px", | ||
"width": "36px", | ||
} | ||
} | ||
> | ||
A | ||
</span> | ||
<img | ||
alt="" | ||
aria-hidden="true" | ||
className="mx_BaseAvatar_image" | ||
data-testid="avatar-img" | ||
onError={[Function]} | ||
src="data:image/png;base64,00" | ||
style={ | ||
{ | ||
"height": "36px", | ||
"width": "36px", | ||
} | ||
} | ||
title="@alice:server" | ||
/> | ||
</span> | ||
</BaseAvatar> | ||
</MemberAvatar> | ||
</div> | ||
</OptionalTooltip> | ||
</div> | ||
</ForwardRef> | ||
</span> | ||
</SmartMarker> | ||
</BeaconMarker> | ||
<span | ||
aria-hidden="true" | ||
class="mx_BaseAvatar_initial" | ||
style="font-size: 23.400000000000002px; width: 36px; line-height: 36px;" | ||
> | ||
A | ||
</span> | ||
<img | ||
alt="" | ||
aria-hidden="true" | ||
class="mx_BaseAvatar_image" | ||
data-testid="avatar-img" | ||
src="data:image/png;base64,00" | ||
style="width: 36px; height: 36px;" | ||
title="@alice:server" | ||
/> | ||
</span> | ||
</div> | ||
</div> | ||
</span> | ||
</DocumentFragment> | ||
`; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you spy on
maplibregl.Marker.setLngLat
to assert the uri is updated instead of this? Similar to how theSmartMarker
tests work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a look at that, thanks for the suggestion. It didn't feel good doing this and I'm in a similar scenario trying to rewrite another test