@esri/solutions-components 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-input-text_5.cjs.entry.js +36 -36
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +1 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
- package/dist/cjs/{solution-store-70002b57.js → solution-store-ca4639d5.js} +3 -3
- package/dist/collection/components/add-record-modal/test/add-record-modal.e2e.js +24 -0
- package/dist/collection/components/add-record-modal/test/add-record-modal.spec.js +32 -0
- package/dist/collection/components/buffer-tools/test/buffer-tools.e2e.js +24 -0
- package/dist/collection/components/buffer-tools/test/buffer-tools.spec.js +157 -0
- package/dist/collection/components/card-manager/test/card-manager.e2e.js +24 -0
- package/dist/collection/components/card-manager/test/card-manager.spec.js +32 -0
- package/dist/collection/components/comment-card/test/comment-card.e2e.js +24 -0
- package/dist/collection/components/comment-card/test/comment-card.spec.js +32 -0
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.e2e.js +24 -0
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.spec.js +32 -0
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.e2e.js +24 -0
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.spec.js +32 -0
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.e2e.js +24 -0
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.spec.js +32 -0
- package/dist/collection/components/edit-record-modal/test/edit-record-modal.e2e.js +24 -0
- package/dist/collection/components/edit-record-modal/test/edit-record-modal.spec.js +32 -0
- package/dist/collection/components/info-card/test/info-card.e2e.js +24 -0
- package/dist/collection/components/info-card/test/info-card.spec.js +32 -0
- package/dist/collection/components/json-editor/test/json-editor.e2e.js +31 -0
- package/dist/collection/components/json-editor/test/json-editor.spec.js +60 -0
- package/dist/collection/components/layer-table/test/layer-table.e2e.js +24 -0
- package/dist/collection/components/layer-table/test/layer-table.spec.js +32 -0
- package/dist/collection/components/list-item/test/list-item.e2e.js +24 -0
- package/dist/collection/components/list-item/test/list-item.spec.js +32 -0
- package/dist/collection/components/map-card/test/map-card.e2e.js +24 -0
- package/dist/collection/components/map-card/test/map-card.spec.js +32 -0
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.e2e.js +24 -0
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.spec.js +32 -0
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.e2e.js +24 -0
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.spec.js +109 -0
- package/dist/collection/components/map-search/test/map-search.e2e.js +24 -0
- package/dist/collection/components/map-search/test/map-search.spec.js +53 -0
- package/dist/collection/components/map-select-tools/map-select-tools.js +36 -36
- package/dist/collection/components/map-select-tools/test/map-select-tools.e2e.js +24 -0
- package/dist/collection/components/map-select-tools/test/map-select-tools.spec.js +349 -0
- package/dist/collection/components/media-card/test/media-card.e2e.js +24 -0
- package/dist/collection/components/media-card/test/media-card.spec.js +32 -0
- package/dist/collection/components/pci-calculator/test/pci-calculator.e2e.js +24 -0
- package/dist/collection/components/pci-calculator/test/pci-calculator.spec.js +32 -0
- package/dist/collection/components/pdf-download/test/pdf-download.e2e.js +71 -0
- package/dist/collection/components/pdf-download/test/pdf-download.spec.js +104 -0
- package/dist/collection/components/public-notification/test/public-notification.e2e.js +95 -0
- package/dist/collection/components/public-notification/test/public-notification.spec.js +149 -0
- package/dist/collection/components/refine-selection/refine-selection.css +85 -85
- package/dist/collection/components/solution-configuration/test/solution-configuration.e2e.js +31 -0
- package/dist/collection/components/solution-configuration/test/solution-configuration.spec.js +114 -0
- package/dist/collection/components/solution-contents/test/solution-contents.e2e.js +89 -0
- package/dist/collection/components/solution-contents/test/solution-contents.spec.js +138 -0
- package/dist/collection/components/solution-item/test/solution-item.e2e.js +31 -0
- package/dist/collection/components/solution-item/test/solution-item.spec.js +72 -0
- package/dist/collection/components/solution-item-details/test/solution-item-details.e2e.js +31 -0
- package/dist/collection/components/solution-item-details/test/solution-item-details.spec.js +137 -0
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.e2e.js +24 -0
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.spec.js +34 -0
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.e2e.js +31 -0
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.spec.js +49 -0
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.e2e.js +31 -0
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.spec.js +60 -0
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.e2e.js +31 -0
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.spec.js +50 -0
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.e2e.js +31 -0
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +170 -0
- package/dist/collection/components/solution-template-data/test/solution-template-data.e2e.js +31 -0
- package/dist/collection/components/solution-template-data/test/solution-template-data.spec.js +55 -0
- package/dist/collection/components/solution-variables/test/solution-variables.e2e.js +31 -0
- package/dist/collection/components/solution-variables/test/solution-variables.spec.js +126 -0
- package/dist/collection/utils/publicNotificationUtils.js +45 -0
- package/dist/collection/utils/templates.e2e.js +25 -0
- package/dist/collection/utils/test/csvUtils.spec.js +46 -0
- package/dist/collection/utils/test/downloadUtils.spec.js +102 -0
- package/dist/collection/utils/test/pciUtils.spec.js +297 -0
- package/dist/collection/utils/test/solution-store.spec.js +439 -0
- package/dist/components/map-select-tools2.js +36 -36
- package/dist/components/solution-store.js +3 -3
- package/dist/esm/calcite-input-text_5.entry.js +36 -36
- package/dist/esm/calcite-shell-panel_14.entry.js +1 -1
- package/dist/esm/solution-configuration.entry.js +1 -1
- package/dist/esm/solution-contents_3.entry.js +1 -1
- package/dist/esm/{solution-store-5d068b07.js → solution-store-70f874f8.js} +3 -3
- package/dist/solutions-components/{p-41802f6b.entry.js → p-16dfb254.entry.js} +1 -1
- package/dist/solutions-components/{p-4769a2a5.entry.js → p-5ed755a2.entry.js} +1 -1
- package/dist/solutions-components/{p-826a814d.js → p-78719506.js} +2 -2
- package/dist/solutions-components/{p-9f620303.entry.js → p-b4b19fd3.entry.js} +1 -1
- package/dist/solutions-components/{p-24fe6e1c.entry.js → p-d5d5942d.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/common.js +291 -0
- package/dist/solutions-components/utils/csvDownload.js +36 -0
- package/dist/solutions-components/utils/csvUtils.js +32 -0
- package/dist/solutions-components/utils/downloadUtils.js +386 -0
- package/dist/solutions-components/utils/interfaces.js +56 -0
- package/dist/solutions-components/utils/languageUtil.js +85 -0
- package/dist/solutions-components/utils/loadModules.js +20 -0
- package/dist/solutions-components/utils/locale.js +56 -0
- package/dist/solutions-components/utils/mapViewUtils.js +140 -0
- package/dist/solutions-components/utils/pciUtils.js +837 -0
- package/dist/solutions-components/utils/pdfUtils.js +62 -0
- package/dist/solutions-components/utils/publicNotificationStore.js +38 -0
- package/dist/solutions-components/utils/publicNotificationUtils.js +45 -0
- package/dist/solutions-components/utils/queryUtils.js +148 -0
- package/dist/solutions-components/utils/solution-store.js +579 -0
- package/dist/solutions-components/utils/templates.e2e.js +25 -0
- package/dist/solutions-components/utils/templates.js +341 -0
- package/dist/solutions-components/utils/test/csvUtils.spec.js +46 -0
- package/dist/solutions-components/utils/test/downloadUtils.spec.js +102 -0
- package/dist/solutions-components/utils/test/mocks/jsApi.js +74 -0
- package/dist/solutions-components/utils/test/pciUtils.spec.js +297 -0
- package/dist/solutions-components/utils/test/solution-store.spec.js +439 -0
- package/dist/solutions-components/utils/test/testUtils.js +135 -0
- package/dist/solutions-components/utils/types.js +14 -0
- package/dist/solutions-components_commit.txt +7 -0
- package/package.json +7 -7
@@ -874,34 +874,37 @@ const MapSelectTools = class {
|
|
874
874
|
*/
|
875
875
|
async _sketchGraphicsChanged(event, forceUpdate = false) {
|
876
876
|
const graphics = event.detail.graphics;
|
877
|
-
if (
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
this.
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
877
|
+
if (graphics.length > 0 && graphics[0]) {
|
878
|
+
if (!forceUpdate) {
|
879
|
+
this._sketchGraphic = graphics[0];
|
880
|
+
}
|
881
|
+
this._workflowType = this._useLayerFeaturesEnabled ? interfaces.EWorkflowType.SELECT : interfaces.EWorkflowType.SKETCH;
|
882
|
+
if (this._workflowType === interfaces.EWorkflowType.SKETCH) {
|
883
|
+
this._drawTools.updateGraphics();
|
884
|
+
}
|
885
|
+
this._updateLabel();
|
886
|
+
this._clearSearchWidget();
|
887
|
+
if (this._useLayerFeaturesEnabled && !forceUpdate) {
|
888
|
+
// Will only ever be a single graphic
|
889
|
+
const geometries = Array.isArray(graphics) ? graphics.map(g => g.geometry) : this.geometries;
|
890
|
+
await this._selectLayerFeatures(geometries[0]);
|
891
|
+
}
|
892
|
+
else {
|
893
|
+
const oids = graphics.reduce((prev, cur) => {
|
894
|
+
var _a;
|
895
|
+
if ((_a = cur === null || cur === void 0 ? void 0 : cur.layer) === null || _a === void 0 ? void 0 : _a.objectIdField) {
|
896
|
+
prev.push(cur.attributes[cur.layer.objectIdField]);
|
897
|
+
}
|
898
|
+
else if (cur.getObjectId) {
|
899
|
+
prev.push(cur.getObjectId());
|
900
|
+
}
|
901
|
+
return prev;
|
902
|
+
}, []);
|
903
|
+
const useOIDs = event.detail.useOIDs && oids.length > 0;
|
904
|
+
this._updateSelection(graphics, useOIDs, oids);
|
905
|
+
if (useOIDs) {
|
906
|
+
await this._highlightFeatures(oids);
|
898
907
|
}
|
899
|
-
return prev;
|
900
|
-
}, []);
|
901
|
-
const useOIDs = event.detail.useOIDs && oids.length > 0;
|
902
|
-
this._updateSelection(graphics, useOIDs, oids);
|
903
|
-
if (useOIDs) {
|
904
|
-
await this._highlightFeatures(oids);
|
905
908
|
}
|
906
909
|
}
|
907
910
|
}
|
@@ -1023,7 +1026,6 @@ const MapSelectTools = class {
|
|
1023
1026
|
this._selectedIds = [];
|
1024
1027
|
this._distance = undefined;
|
1025
1028
|
this._unit = undefined;
|
1026
|
-
this._sketchGraphic = undefined;
|
1027
1029
|
if (clearLabel) {
|
1028
1030
|
this._selectionLabel = "";
|
1029
1031
|
this._labelName.value = "";
|
@@ -1190,14 +1192,12 @@ const MapSelectTools = class {
|
|
1190
1192
|
*/
|
1191
1193
|
_useLayerFeaturesEnabledChanged() {
|
1192
1194
|
this._useLayerFeaturesEnabled = !this._useLayerFeaturesEnabled;
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
});
|
1200
|
-
}
|
1195
|
+
void this._sketchGraphicsChanged({
|
1196
|
+
detail: {
|
1197
|
+
graphics: [this._sketchGraphic],
|
1198
|
+
useOIDs: false
|
1199
|
+
}
|
1200
|
+
});
|
1201
1201
|
}
|
1202
1202
|
/**
|
1203
1203
|
* Fetches the component's translations
|
@@ -22,7 +22,7 @@ const sharedListRender = require('./shared-list-render-298c77b3.js');
|
|
22
22
|
const resources$1 = require('./resources-bbd38cff.js');
|
23
23
|
const resources = require('./resources-b76585de.js');
|
24
24
|
const locale$1 = require('./locale-b113c6b2.js');
|
25
|
-
const solutionStore = require('./solution-store-
|
25
|
+
const solutionStore = require('./solution-store-ca4639d5.js');
|
26
26
|
const interfaces = require('./interfaces-842c84a1.js');
|
27
27
|
require('./resources-1f836572.js');
|
28
28
|
require('./key-d55baa11.js');
|
@@ -8,7 +8,7 @@
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
9
9
|
|
10
10
|
const index = require('./index-6654298b.js');
|
11
|
-
const solutionStore = require('./solution-store-
|
11
|
+
const solutionStore = require('./solution-store-ca4639d5.js');
|
12
12
|
const locale = require('./locale-b113c6b2.js');
|
13
13
|
require('./index-e1b1954f.js');
|
14
14
|
require('./interfaces-842c84a1.js');
|
@@ -8,7 +8,7 @@
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
9
9
|
|
10
10
|
const index = require('./index-6654298b.js');
|
11
|
-
const solutionStore = require('./solution-store-
|
11
|
+
const solutionStore = require('./solution-store-ca4639d5.js');
|
12
12
|
const locale = require('./locale-b113c6b2.js');
|
13
13
|
require('./interfaces-842c84a1.js');
|
14
14
|
require('./index-e1b1954f.js');
|
@@ -899,7 +899,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
899
899
|
});
|
900
900
|
|
901
901
|
/*!
|
902
|
-
* @esri/arcgis-html-sanitizer - v3.0.
|
902
|
+
* @esri/arcgis-html-sanitizer - v3.0.1 - Tue Nov 15 2022 09:46:54 GMT-0800 (Pacific Standard Time)
|
903
903
|
* Copyright (c) 2022 - Environmental Systems Research Institute, Inc.
|
904
904
|
* Apache-2.0
|
905
905
|
*
|
@@ -2134,7 +2134,7 @@ function parseTag$1(html, onTag, escapeHtml) {
|
|
2134
2134
|
lastPos = currentPos;
|
2135
2135
|
continue;
|
2136
2136
|
}
|
2137
|
-
if (c === ">"
|
2137
|
+
if (c === ">") {
|
2138
2138
|
rethtml += escapeHtml(html.slice(lastPos, tagStart));
|
2139
2139
|
currentHtml = html.slice(tagStart, currentPos + 1);
|
2140
2140
|
currentTagName = getTagName(currentHtml);
|
@@ -2169,7 +2169,7 @@ function parseTag$1(html, onTag, escapeHtml) {
|
|
2169
2169
|
}
|
2170
2170
|
}
|
2171
2171
|
}
|
2172
|
-
if (lastPos <
|
2172
|
+
if (lastPos < html.length) {
|
2173
2173
|
rethtml += escapeHtml(html.substr(lastPos));
|
2174
2174
|
}
|
2175
2175
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
xdescribe('add-record-modal', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
const page = await newE2EPage();
|
20
|
+
await page.setContent('<add-record-modal></add-record-modal>');
|
21
|
+
const element = await page.find('add-record-modal');
|
22
|
+
expect(element).toHaveClass('hydrated');
|
23
|
+
});
|
24
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { AddRecordModal } from '../add-record-modal';
|
18
|
+
xdescribe('add-record-modal', () => {
|
19
|
+
it('renders', async () => {
|
20
|
+
const page = await newSpecPage({
|
21
|
+
components: [AddRecordModal],
|
22
|
+
html: `<add-record-modal></add-record-modal>`,
|
23
|
+
});
|
24
|
+
expect(page.root).toEqualHtml(`
|
25
|
+
<add-record-modal>
|
26
|
+
<mock:shadow-root>
|
27
|
+
<slot></slot>
|
28
|
+
</mock:shadow-root>
|
29
|
+
</add-record-modal>
|
30
|
+
`);
|
31
|
+
});
|
32
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
xdescribe('buffer-tools', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
const page = await newE2EPage();
|
20
|
+
await page.setContent('<buffer-tools></buffer-tools>');
|
21
|
+
const element = await page.find('buffer-tools');
|
22
|
+
expect(element).toHaveClass('hydrated');
|
23
|
+
});
|
24
|
+
});
|
@@ -0,0 +1,157 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { h } from '@stencil/core';
|
17
|
+
import { newSpecPage } from '@stencil/core/testing';
|
18
|
+
import { BufferTools } from '../buffer-tools';
|
19
|
+
import * as locale from "../../../utils/locale";
|
20
|
+
import * as translations from "../../../assets/t9n/buffer-tools/resources.json";
|
21
|
+
jest.setTimeout(30000);
|
22
|
+
afterEach(() => {
|
23
|
+
jest.restoreAllMocks();
|
24
|
+
});
|
25
|
+
beforeEach(() => {
|
26
|
+
jest.spyOn(locale, "getLocaleComponentStrings").mockImplementation(() => [
|
27
|
+
translations
|
28
|
+
]);
|
29
|
+
jest.useFakeTimers();
|
30
|
+
});
|
31
|
+
xdescribe('buffer-tools', () => {
|
32
|
+
it('renders as text', async () => {
|
33
|
+
const page = await newSpecPage({
|
34
|
+
autoApplyChanges: true,
|
35
|
+
components: [BufferTools],
|
36
|
+
template: () => (h("buffer-tools", null)),
|
37
|
+
});
|
38
|
+
expect(page.root).toEqualHtml(`
|
39
|
+
<buffer-tools>
|
40
|
+
<mock:shadow-root>
|
41
|
+
<div class="c-container">
|
42
|
+
<calcite-input class="padding-end-1" number-button-type="vertical" placeholder="0" type="number"></calcite-input>
|
43
|
+
<calcite-select class="flex-1" label="label">
|
44
|
+
<calcite-option label="Feet" value="feet"></calcite-option>
|
45
|
+
<calcite-option label="Meters" selected="" value="meters"></calcite-option>
|
46
|
+
<calcite-option label="Miles" value="miles"></calcite-option>
|
47
|
+
<calcite-option label="Kilometers" value="kilometers"></calcite-option>
|
48
|
+
</calcite-select>
|
49
|
+
</div>
|
50
|
+
</mock:shadow-root>
|
51
|
+
</buffer-tools>
|
52
|
+
`);
|
53
|
+
});
|
54
|
+
it('renders as slider', async () => {
|
55
|
+
const page = await newSpecPage({
|
56
|
+
autoApplyChanges: true,
|
57
|
+
components: [BufferTools],
|
58
|
+
template: () => (h("buffer-tools", { appearance: 'slider' })),
|
59
|
+
});
|
60
|
+
expect(page.root).toEqualHtml(`
|
61
|
+
<buffer-tools>
|
62
|
+
<mock:shadow-root>
|
63
|
+
<div>
|
64
|
+
<calcite-slider labelhandles="" max="100" min="0" ticks="10"></calcite-slider>
|
65
|
+
</div>
|
66
|
+
</mock:shadow-root>
|
67
|
+
</buffer-tools>
|
68
|
+
`);
|
69
|
+
});
|
70
|
+
it('_setDistance', async () => {
|
71
|
+
const timeout = jest.spyOn(global, 'setTimeout');
|
72
|
+
const cleartimeout = jest.spyOn(global, 'clearTimeout');
|
73
|
+
const page = await newSpecPage({
|
74
|
+
autoApplyChanges: true,
|
75
|
+
components: [BufferTools],
|
76
|
+
template: () => (h("buffer-tools", null)),
|
77
|
+
});
|
78
|
+
expect(page.root).toEqualHtml(`
|
79
|
+
<buffer-tools>
|
80
|
+
<mock:shadow-root>
|
81
|
+
<div class="c-container">
|
82
|
+
<calcite-input class="padding-end-1" number-button-type="vertical" placeholder="0" type="number"></calcite-input>
|
83
|
+
<calcite-select class="flex-1" label="label">
|
84
|
+
<calcite-option label="Feet" value="feet"></calcite-option>
|
85
|
+
<calcite-option label="Meters" selected="" value="meters"></calcite-option>
|
86
|
+
<calcite-option label="Miles" value="miles"></calcite-option>
|
87
|
+
<calcite-option label="Kilometers" value="kilometers"></calcite-option>
|
88
|
+
</calcite-select>
|
89
|
+
</div>
|
90
|
+
</mock:shadow-root>
|
91
|
+
</buffer-tools>
|
92
|
+
`);
|
93
|
+
let matcher = undefined;
|
94
|
+
page.root.geometries = [{}];
|
95
|
+
jest.runAllTimers();
|
96
|
+
page.doc.addEventListener("bufferComplete", (evt) => {
|
97
|
+
expect(evt.detail).toEqual(matcher);
|
98
|
+
});
|
99
|
+
page.rootInstance._testAccess("_setDistance", { detail: { value: 0 } });
|
100
|
+
jest.runAllTimers();
|
101
|
+
page.rootInstance._testAccess("_setDistance", { detail: { value: 1 } });
|
102
|
+
jest.runAllTimers();
|
103
|
+
expect(timeout).toBeCalledTimes(3);
|
104
|
+
expect(cleartimeout).toBeCalledTimes(2);
|
105
|
+
timeout.mockReset();
|
106
|
+
timeout.mockRestore();
|
107
|
+
cleartimeout.mockReset();
|
108
|
+
cleartimeout.mockRestore();
|
109
|
+
});
|
110
|
+
it('geometries watch', async () => {
|
111
|
+
const timeout = jest.spyOn(global, 'setTimeout');
|
112
|
+
const cleartimeout = jest.spyOn(global, 'clearTimeout');
|
113
|
+
const page = await newSpecPage({
|
114
|
+
autoApplyChanges: true,
|
115
|
+
components: [BufferTools],
|
116
|
+
template: () => (h("buffer-tools", null)),
|
117
|
+
});
|
118
|
+
expect(page.root).toEqualHtml(`
|
119
|
+
<buffer-tools>
|
120
|
+
<mock:shadow-root>
|
121
|
+
<div class="c-container">
|
122
|
+
<calcite-input class="padding-end-1" number-button-type="vertical" placeholder="0" type="number"></calcite-input>
|
123
|
+
<calcite-select class="flex-1" label="label">
|
124
|
+
<calcite-option label="Feet" value="feet"></calcite-option>
|
125
|
+
<calcite-option label="Meters" selected="" value="meters"></calcite-option>
|
126
|
+
<calcite-option label="Miles" value="miles"></calcite-option>
|
127
|
+
<calcite-option label="Kilometers" value="kilometers"></calcite-option>
|
128
|
+
</calcite-select>
|
129
|
+
</div>
|
130
|
+
</mock:shadow-root>
|
131
|
+
</buffer-tools>
|
132
|
+
`);
|
133
|
+
page.root.geometries = [{}];
|
134
|
+
page.root.geometries = [];
|
135
|
+
expect(timeout).toBeCalledTimes(3);
|
136
|
+
expect(cleartimeout).toBeCalledTimes(2);
|
137
|
+
timeout.mockReset();
|
138
|
+
timeout.mockRestore();
|
139
|
+
cleartimeout.mockReset();
|
140
|
+
cleartimeout.mockRestore();
|
141
|
+
});
|
142
|
+
it('have expected defaults', () => {
|
143
|
+
const bufferTools = new BufferTools();
|
144
|
+
expect(bufferTools.appearance).toEqual('text');
|
145
|
+
expect(bufferTools.distance).toEqual(0);
|
146
|
+
expect(bufferTools.geometries).toEqual([]);
|
147
|
+
expect(bufferTools.sliderMax).toEqual(100);
|
148
|
+
expect(bufferTools.sliderMin).toEqual(0);
|
149
|
+
expect(bufferTools.sliderTicks).toEqual(10);
|
150
|
+
expect(bufferTools.unionResults).toEqual(true);
|
151
|
+
expect(bufferTools.unit).toEqual('meters');
|
152
|
+
});
|
153
|
+
it('have expected defaults', () => {
|
154
|
+
const bufferTools = new BufferTools();
|
155
|
+
bufferTools._testAccess("_setUnit", "meters");
|
156
|
+
});
|
157
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
xdescribe('card-manager', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
const page = await newE2EPage();
|
20
|
+
await page.setContent('<card-manager></card-manager>');
|
21
|
+
const element = await page.find('card-manager');
|
22
|
+
expect(element).toHaveClass('hydrated');
|
23
|
+
});
|
24
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { CardManager } from '../card-manager';
|
18
|
+
xdescribe('card-manager', () => {
|
19
|
+
it('renders', async () => {
|
20
|
+
const page = await newSpecPage({
|
21
|
+
components: [CardManager],
|
22
|
+
html: `<card-manager></card-manager>`,
|
23
|
+
});
|
24
|
+
expect(page.root).toEqualHtml(`
|
25
|
+
<card-manager>
|
26
|
+
<mock:shadow-root>
|
27
|
+
<slot></slot>
|
28
|
+
</mock:shadow-root>
|
29
|
+
</card-manager>
|
30
|
+
`);
|
31
|
+
});
|
32
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
xdescribe('comment-card', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
const page = await newE2EPage();
|
20
|
+
await page.setContent('<comment-card></comment-card>');
|
21
|
+
const element = await page.find('comment-card');
|
22
|
+
expect(element).toHaveClass('hydrated');
|
23
|
+
});
|
24
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { CommentCard } from '../comment-card';
|
18
|
+
xdescribe('comment-card', () => {
|
19
|
+
it('renders', async () => {
|
20
|
+
const page = await newSpecPage({
|
21
|
+
components: [CommentCard],
|
22
|
+
html: `<comment-card></comment-card>`,
|
23
|
+
});
|
24
|
+
expect(page.root).toEqualHtml(`
|
25
|
+
<comment-card>
|
26
|
+
<mock:shadow-root>
|
27
|
+
<slot></slot>
|
28
|
+
</mock:shadow-root>
|
29
|
+
</comment-card>
|
30
|
+
`);
|
31
|
+
});
|
32
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
xdescribe('crowdsource-manager', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
const page = await newE2EPage();
|
20
|
+
await page.setContent('<crowdsource-manager></crowdsource-manager>');
|
21
|
+
const element = await page.find('crowdsource-manager');
|
22
|
+
expect(element).toHaveClass('hydrated');
|
23
|
+
});
|
24
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { CrowdsourceManager } from '../crowdsource-manager';
|
18
|
+
xdescribe('crowdsource-manager', () => {
|
19
|
+
it('renders', async () => {
|
20
|
+
const page = await newSpecPage({
|
21
|
+
components: [CrowdsourceManager],
|
22
|
+
html: `<crowdsource-manager></crowdsource-manager>`,
|
23
|
+
});
|
24
|
+
expect(page.root).toEqualHtml(`
|
25
|
+
<crowdsource-manager>
|
26
|
+
<mock:shadow-root>
|
27
|
+
<slot></slot>
|
28
|
+
</mock:shadow-root>
|
29
|
+
</crowdsource-manager>
|
30
|
+
`);
|
31
|
+
});
|
32
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
xdescribe('crowdsource-reporter', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
const page = await newE2EPage();
|
20
|
+
await page.setContent('<crowdsource-reporter></crowdsource-reporter>');
|
21
|
+
const element = await page.find('crowdsource-reporter');
|
22
|
+
expect(element).toHaveClass('hydrated');
|
23
|
+
});
|
24
|
+
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { CrowdsourceReporter } from '../crowdsource-reporter';
|
18
|
+
xdescribe('crowdsource-reporter', () => {
|
19
|
+
it('renders', async () => {
|
20
|
+
const page = await newSpecPage({
|
21
|
+
components: [CrowdsourceReporter],
|
22
|
+
html: `<crowdsource-reporter></crowdsource-reporter>`,
|
23
|
+
});
|
24
|
+
expect(page.root).toEqualHtml(`
|
25
|
+
<crowdsource-reporter>
|
26
|
+
<mock:shadow-root>
|
27
|
+
<slot></slot>
|
28
|
+
</mock:shadow-root>
|
29
|
+
</crowdsource-reporter>
|
30
|
+
`);
|
31
|
+
});
|
32
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
xdescribe('deduct-calculator', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
const page = await newE2EPage();
|
20
|
+
await page.setContent('<deduct-calculator></deduct-calculator>');
|
21
|
+
const element = await page.find('deduct-calculator');
|
22
|
+
expect(element).toHaveClass('hydrated');
|
23
|
+
});
|
24
|
+
});
|