Migrate ZoomButtons-test to react-testing-library (#10104)

This commit is contained in:
Michael Weimann 2023-02-08 09:31:24 +01:00 committed by GitHub
parent cb67457860
commit 2c30e6d909
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 80 deletions

View file

@ -135,7 +135,7 @@ exports[`<LocationViewDialog /> renders map correctly 1`] = `
>
<AccessibleButton
className="mx_ZoomButtons_button"
data-test-id="map-zoom-in-button"
data-testid="map-zoom-in-button"
element="div"
onClick={[Function]}
role="button"
@ -144,7 +144,7 @@ exports[`<LocationViewDialog /> renders map correctly 1`] = `
>
<div
className="mx_AccessibleButton mx_ZoomButtons_button"
data-test-id="map-zoom-in-button"
data-testid="map-zoom-in-button"
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
@ -159,7 +159,7 @@ exports[`<LocationViewDialog /> renders map correctly 1`] = `
</AccessibleButton>
<AccessibleButton
className="mx_ZoomButtons_button"
data-test-id="map-zoom-out-button"
data-testid="map-zoom-out-button"
element="div"
onClick={[Function]}
role="button"
@ -168,7 +168,7 @@ exports[`<LocationViewDialog /> renders map correctly 1`] = `
>
<div
className="mx_AccessibleButton mx_ZoomButtons_button"
data-test-id="map-zoom-out-button"
data-testid="map-zoom-out-button"
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}

View file

@ -1,74 +1,32 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<ZoomButtons /> renders buttons 1`] = `
<ZoomButtons
map={
MockMap {
"_events": {},
"_eventsCount": 0,
"_maxListeners": undefined,
"addControl": [MockFunction],
"fitBounds": [MockFunction],
"removeControl": [MockFunction],
"setCenter": [MockFunction],
"setStyle": [MockFunction],
"zoomIn": [MockFunction],
"zoomOut": [MockFunction],
Symbol(kCapture): false,
}
}
>
<DocumentFragment>
<div
className="mx_ZoomButtons"
class="mx_ZoomButtons"
>
<AccessibleButton
className="mx_ZoomButtons_button"
data-test-id="map-zoom-in-button"
element="div"
onClick={[Function]}
<div
class="mx_AccessibleButton mx_ZoomButtons_button"
data-testid="map-zoom-in-button"
role="button"
tabIndex={0}
tabindex="0"
title="Zoom in"
>
<div
className="mx_AccessibleButton mx_ZoomButtons_button"
data-test-id="map-zoom-in-button"
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
role="button"
tabIndex={0}
title="Zoom in"
>
<div
className="mx_ZoomButtons_icon"
/>
</div>
</AccessibleButton>
<AccessibleButton
className="mx_ZoomButtons_button"
data-test-id="map-zoom-out-button"
element="div"
onClick={[Function]}
class="mx_ZoomButtons_icon"
/>
</div>
<div
class="mx_AccessibleButton mx_ZoomButtons_button"
data-testid="map-zoom-out-button"
role="button"
tabIndex={0}
tabindex="0"
title="Zoom out"
>
<div
className="mx_AccessibleButton mx_ZoomButtons_button"
data-test-id="map-zoom-out-button"
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
role="button"
tabIndex={0}
title="Zoom out"
>
<div
className="mx_ZoomButtons_icon"
/>
</div>
</AccessibleButton>
class="mx_ZoomButtons_icon"
/>
</div>
</div>
</ZoomButtons>
</DocumentFragment>
`;