Skip to content
Snippets Groups Projects

Resolve "[MIN-327] cannot browse asthma map"

Merged Piotr Gawron requested to merge 260-min-327-cannot-browse-asthma-map into development
2 files
+ 63
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -70,6 +70,16 @@ describe('map thunks - utils', () => {
expect(backgroundId).toBe(0);
});
it('should return main map background id if query param background id is invalid', () => {
const store: RootState = {
...INITIAL_STORE_STATE_MOCK,
backgrounds: { ...BACKGROUND_INITIAL_STATE_MOCK, data: BACKGROUNDS_MOCK },
};
const backgroundId = getBackgroundId(store, QUERY_DATA_WITH_BG);
expect(backgroundId).toBe(13);
});
});
describe('getInitMapPosition', () => {
@@ -96,7 +106,7 @@ describe('map thunks - utils', () => {
});
describe('getInitMapSizeAndModelId', () => {
it('should return correct mapsize and modelid when modelId is provided in queryData', () => {
it('should return correct map size and modelId when modelId is provided in queryData', () => {
const payload = getInitMapSizeAndModelId(STATE_WITH_MODELS, QUERY_DATA_WITH_MODELID);
expect(payload).toEqual({
@@ -104,7 +114,7 @@ describe('map thunks - utils', () => {
size: { height: 1171.9429798877356, maxZoom: 5, minZoom: 2, tileSize: 256, width: 1652.75 },
});
});
it('should return correct mapsize and modelId if query params do not include modelId', () => {
it('should return correct map size and modelId if query params do not include modelId', () => {
const payload = getInitMapSizeAndModelId(STATE_WITH_MODELS, EMPTY_QUERY_DATA);
expect(payload).toEqual({
modelId: 5053,
@@ -117,6 +127,22 @@ describe('map thunks - utils', () => {
},
});
});
it('should return correct map size and modelId if query params include invalid modelId', () => {
const payload = getInitMapSizeAndModelId(STATE_WITH_MODELS, {
...EMPTY_QUERY_DATA,
modelId: 1234567,
});
expect(payload).toEqual({
modelId: 5053,
size: {
height: 13503,
maxZoom: 9,
minZoom: 2,
tileSize: 256,
width: 26779.25,
},
});
});
});
describe('getOpenedMaps ', () => {
Loading