Skip to content

Commit a9ca4a8

Browse files
igorDykhtaIhor Dykhta
andauthored
chore: fix tests (#3403)
* chore: fix tests Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local> * add RTLTextPlugin prop to kepler Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local> --------- Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local> Co-authored-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
1 parent ea81bbf commit a9ca4a8

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

src/components/src/kepler-gl.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ export const mapFieldsSelector = (props: KeplerGLProps, index = 0) => {
196196
bottomMapContainerProps: props.bottomMapContainerProps,
197197

198198
// transformRequest for Mapbox basemaps
199-
transformRequest: props.transformRequest
199+
transformRequest: props.transformRequest,
200+
201+
RTLTextPlugin: props.RTLTextPlugin
200202
};
201203
};
202204

@@ -466,6 +468,9 @@ type KeplerGLBasicProps = {
466468
bottomMapContainerProps?: object;
467469

468470
transformRequest?: (url: string) => {url: string};
471+
472+
/** Pass `false` to disable the remote RTL text plugin, or a URL string to self-host it. */
473+
RTLTextPlugin?: string | false;
469474
};
470475

471476
type KeplerGLProps = KeplerGlState & KeplerGlActions & KeplerGLBasicProps;

src/components/src/map-container.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ export interface MapContainerProps {
405405
bottomMapContainerProps: any;
406406
transformRequest?: (url: string, resourceType?: string) => {url: string};
407407

408+
/** Pass `false` to disable the remote RTL text plugin, or a URL string to self-host it. */
409+
RTLTextPlugin?: string | false;
410+
408411
datasetAttributions?: DatasetAttribution[];
409412
attributionLogos?: AttributionWithStyle[];
410413

@@ -1198,6 +1201,10 @@ export default function MapContainerFactory(
11981201
transformRequest(currentStyle?.accessToken || mapboxApiAccessToken)
11991202
};
12001203

1204+
if (this.props.RTLTextPlugin !== undefined) {
1205+
mapProps.RTLTextPlugin = this.props.RTLTextPlugin;
1206+
}
1207+
12011208
if (useMapboxAdapter) {
12021209
const mapboxConfig = getApplicationConfig().baseMapLibraryConfig[MAP_LIB_OPTIONS.MAPBOX];
12031210
mapProps.mapLib = mapboxConfig.getMapLib();
@@ -1292,6 +1299,9 @@ export default function MapContainerFactory(
12921299
style={MAP_STYLE.top}
12931300
mapboxAccessToken={mapProps.mapboxAccessToken}
12941301
transformRequest={mapProps.transformRequest}
1302+
{...(mapProps.RTLTextPlugin !== undefined
1303+
? {RTLTextPlugin: mapProps.RTLTextPlugin}
1304+
: {})}
12951305
{...(useMapboxAdapter
12961306
? {
12971307
mapLib:

test/node/utils/export-utils-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test('exportUtils -> calculateExportImageSize', t => {
122122
ratio: EXPORT_IMG_RATIOS.SCREEN,
123123
resolution: '1920x1080'
124124
}),
125-
{scale: undefined, imageW: 1920, imageH: 1080},
125+
{zoomOffset: 0, scale: 1, imageW: 1920, imageH: 1080},
126126
'Should return fixed resolution 1920x1080'
127127
);
128128

@@ -133,7 +133,7 @@ test('exportUtils -> calculateExportImageSize', t => {
133133
ratio: EXPORT_IMG_RATIOS.SCREEN,
134134
resolution: '1280x720'
135135
}),
136-
{scale: undefined, imageW: 1280, imageH: 720},
136+
{zoomOffset: 0, scale: 1, imageW: 1280, imageH: 720},
137137
'Should return fixed resolution 1280x720'
138138
);
139139

@@ -144,7 +144,7 @@ test('exportUtils -> calculateExportImageSize', t => {
144144
ratio: EXPORT_IMG_RATIOS.SCREEN,
145145
resolution: '2560x1440'
146146
}),
147-
{scale: undefined, imageW: 2560, imageH: 1440},
147+
{zoomOffset: 0, scale: 1, imageW: 2560, imageH: 1440},
148148
'Should return fixed resolution 2560x1440'
149149
);
150150

0 commit comments

Comments
 (0)