kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
216 lines (205 loc) • 25.8 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _react = _interopRequireDefault(require("react"));
var _react2 = require("@testing-library/react");
var _infoHelper = _interopRequireDefault(require("../common/info-helper"));
var _cloudHeader = _interopRequireDefault(require("./cloud-components/cloud-header"));
var _loadStorageMap = _interopRequireDefault(require("./load-storage-map"));
var _componentJestUtils = require("test/helpers/component-jest-utils");
var _useCloudListProvider = require("../hooks/use-cloud-list-provider");
var _constants = require("@kepler.gl/constants");
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
// @ts-nocheck
var InfoHelper = (0, _infoHelper["default"])();
var CloudHeader = (0, _cloudHeader["default"])(InfoHelper);
var LoadStorageMap = (0, _loadStorageMap["default"])(CloudHeader);
var DEFAULT_MAPS = [{
id: '1234',
title: 'first map',
description: 'description 1',
loadParams: {
id: '1234'
}
}, {
id: '5678',
title: 'second map',
description: 'description 2',
loadParams: {
id: '5678'
}
}];
var DEFAULT_PROVIDER = {
name: 'test provider',
icon: jest.fn(),
getManagementUrl: jest.fn().mockImplementation(function () {
return 'provider.url';
}),
listMaps: jest.fn().mockResolvedValue([])
};
var DEFAULT_PROPS = {
onLoadCloudMap: jest.fn()
};
jest.mock('../hooks/use-cloud-list-provider', function () {
return {
useCloudListProvider: jest.fn().mockImplementation(function () {
return {
provider: null,
setProvider: jest.fn(),
cloudProviders: []
};
})
};
});
describe('LoadStorageMap', function () {
afterEach(function () {
jest.clearAllMocks();
});
test('renders provider select and no cloud components when provider is set to null', function () {
var _renderWithTheme = (0, _componentJestUtils.renderWithTheme)( /*#__PURE__*/_react["default"].createElement(LoadStorageMap, DEFAULT_PROPS)),
getByTestId = _renderWithTheme.getByTestId;
expect(getByTestId(_constants.dataTestIds.providerSelect)).toBeInTheDocument();
});
test('renders empty map list because fetchmaps return empty array', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
var _renderWithTheme2, getByText;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_useCloudListProvider.useCloudListProvider.mockImplementation(function () {
return {
provider: DEFAULT_PROVIDER,
setProvider: jest.fn(),
cloudProviders: []
};
});
_renderWithTheme2 = (0, _componentJestUtils.renderWithTheme)( /*#__PURE__*/_react["default"].createElement(LoadStorageMap, DEFAULT_PROPS)), getByText = _renderWithTheme2.getByText;
expect(DEFAULT_PROVIDER.listMaps).toHaveBeenCalled();
// first show loading icon
expect(getByText('modal.loadingDialog.loading')).toBeInTheDocument();
// show empty maps
_context.next = 6;
return (0, _react2.waitFor)(function () {
expect(getByText('modal.loadStorageMap.noSavedMaps')).toBeInTheDocument();
});
case 6:
case "end":
return _context.stop();
}
}, _callee);
})));
test('renders map list because', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
var mapProvider, _renderWithTheme3, getByText;
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
mapProvider = {
name: 'test provider',
icon: jest.fn(),
getManagementUrl: jest.fn().mockImplementation(function () {
return 'provider.url';
}),
listMaps: jest.fn().mockResolvedValue(DEFAULT_MAPS)
};
_useCloudListProvider.useCloudListProvider.mockImplementation(function () {
return {
provider: mapProvider,
setProvider: jest.fn(),
cloudProviders: []
};
});
_renderWithTheme3 = (0, _componentJestUtils.renderWithTheme)( /*#__PURE__*/_react["default"].createElement(LoadStorageMap, DEFAULT_PROPS)), getByText = _renderWithTheme3.getByText;
expect(mapProvider.listMaps).toHaveBeenCalled();
// first show loading icon
expect(getByText('modal.loadingDialog.loading')).toBeInTheDocument();
// show empty maps
_context2.next = 7;
return (0, _react2.waitFor)(function () {
DEFAULT_MAPS.forEach(function (map) {
expect(getByText(map.title)).toBeInTheDocument();
expect(getByText(map.description)).toBeInTheDocument();
});
});
case 7:
case "end":
return _context2.stop();
}
}, _callee2);
})));
test('trigger onLoadCLoudMap when clicking on a map', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
var mapProvider, _renderWithTheme4, getByText;
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
mapProvider = {
name: 'test provider',
icon: jest.fn(),
getManagementUrl: jest.fn().mockImplementation(function () {
return 'provider.url';
}),
listMaps: jest.fn().mockResolvedValue(DEFAULT_MAPS)
};
_useCloudListProvider.useCloudListProvider.mockImplementation(function () {
return {
provider: mapProvider,
setProvider: jest.fn(),
cloudProviders: []
};
});
_renderWithTheme4 = (0, _componentJestUtils.renderWithTheme)( /*#__PURE__*/_react["default"].createElement(LoadStorageMap, DEFAULT_PROPS)), getByText = _renderWithTheme4.getByText;
expect(mapProvider.listMaps).toHaveBeenCalled();
// first show loading icon
expect(getByText('modal.loadingDialog.loading')).toBeInTheDocument();
// click on a map
_context3.next = 7;
return (0, _react2.waitFor)(function () {
var map = DEFAULT_MAPS[0];
// if the component doesn't exist this will throw an exception
var mapTitleComponent = getByText(map.title);
_react2.fireEvent.click(mapTitleComponent);
expect(DEFAULT_PROPS.onLoadCloudMap).toHaveBeenCalled();
});
case 7:
case "end":
return _context3.stop();
}
}, _callee3);
})));
test('renders errors because fetchmaps rejects', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
var rejectableProvider, _renderWithTheme5, getByText;
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
rejectableProvider = {
name: 'test provider',
icon: jest.fn(),
getManagementUrl: jest.fn().mockImplementation(function () {
return 'provider.url';
}),
listMaps: jest.fn().mockRejectedValue(new Error('timeout'))
};
_useCloudListProvider.useCloudListProvider.mockImplementation(function () {
return {
provider: rejectableProvider,
setProvider: jest.fn(),
cloudProviders: []
};
});
_renderWithTheme5 = (0, _componentJestUtils.renderWithTheme)( /*#__PURE__*/_react["default"].createElement(LoadStorageMap, DEFAULT_PROPS)), getByText = _renderWithTheme5.getByText;
expect(rejectableProvider.listMaps).toHaveBeenCalled();
// first show loading icon
expect(getByText('modal.loadingDialog.loading')).toBeInTheDocument();
// show empty maps
_context4.next = 7;
return (0, _react2.waitFor)(function () {
expect(getByText('Error while fetching maps: timeout')).toBeInTheDocument();
});
case 7:
case "end":
return _context4.stop();
}
}, _callee4);
})));
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9yZWFjdDIiLCJfaW5mb0hlbHBlciIsIl9jbG91ZEhlYWRlciIsIl9sb2FkU3RvcmFnZU1hcCIsIl9jb21wb25lbnRKZXN0VXRpbHMiLCJfdXNlQ2xvdWRMaXN0UHJvdmlkZXIiLCJfY29uc3RhbnRzIiwiSW5mb0hlbHBlciIsIkluZm9IZWxwZXJGYWN0b3J5IiwiQ2xvdWRIZWFkZXIiLCJDbG91ZEhlYWRlckZhY3RvcnkiLCJMb2FkU3RvcmFnZU1hcCIsIkxvYWRTdG9yYWdlTWFwRmFjdG9yeSIsIkRFRkFVTFRfTUFQUyIsImlkIiwidGl0bGUiLCJkZXNjcmlwdGlvbiIsImxvYWRQYXJhbXMiLCJERUZBVUxUX1BST1ZJREVSIiwibmFtZSIsImljb24iLCJqZXN0IiwiZm4iLCJnZXRNYW5hZ2VtZW50VXJsIiwibW9ja0ltcGxlbWVudGF0aW9uIiwibGlzdE1hcHMiLCJtb2NrUmVzb2x2ZWRWYWx1ZSIsIkRFRkFVTFRfUFJPUFMiLCJvbkxvYWRDbG91ZE1hcCIsIm1vY2siLCJ1c2VDb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