@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.
Files changed (116) hide show
  1. package/dist/cjs/calcite-input-text_5.cjs.entry.js +36 -36
  2. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -1
  3. package/dist/cjs/solution-configuration.cjs.entry.js +1 -1
  4. package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
  5. package/dist/cjs/{solution-store-70002b57.js → solution-store-ca4639d5.js} +3 -3
  6. package/dist/collection/components/add-record-modal/test/add-record-modal.e2e.js +24 -0
  7. package/dist/collection/components/add-record-modal/test/add-record-modal.spec.js +32 -0
  8. package/dist/collection/components/buffer-tools/test/buffer-tools.e2e.js +24 -0
  9. package/dist/collection/components/buffer-tools/test/buffer-tools.spec.js +157 -0
  10. package/dist/collection/components/card-manager/test/card-manager.e2e.js +24 -0
  11. package/dist/collection/components/card-manager/test/card-manager.spec.js +32 -0
  12. package/dist/collection/components/comment-card/test/comment-card.e2e.js +24 -0
  13. package/dist/collection/components/comment-card/test/comment-card.spec.js +32 -0
  14. package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.e2e.js +24 -0
  15. package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.spec.js +32 -0
  16. package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.e2e.js +24 -0
  17. package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.spec.js +32 -0
  18. package/dist/collection/components/deduct-calculator/test/deduct-calculator.e2e.js +24 -0
  19. package/dist/collection/components/deduct-calculator/test/deduct-calculator.spec.js +32 -0
  20. package/dist/collection/components/edit-record-modal/test/edit-record-modal.e2e.js +24 -0
  21. package/dist/collection/components/edit-record-modal/test/edit-record-modal.spec.js +32 -0
  22. package/dist/collection/components/info-card/test/info-card.e2e.js +24 -0
  23. package/dist/collection/components/info-card/test/info-card.spec.js +32 -0
  24. package/dist/collection/components/json-editor/test/json-editor.e2e.js +31 -0
  25. package/dist/collection/components/json-editor/test/json-editor.spec.js +60 -0
  26. package/dist/collection/components/layer-table/test/layer-table.e2e.js +24 -0
  27. package/dist/collection/components/layer-table/test/layer-table.spec.js +32 -0
  28. package/dist/collection/components/list-item/test/list-item.e2e.js +24 -0
  29. package/dist/collection/components/list-item/test/list-item.spec.js +32 -0
  30. package/dist/collection/components/map-card/test/map-card.e2e.js +24 -0
  31. package/dist/collection/components/map-card/test/map-card.spec.js +32 -0
  32. package/dist/collection/components/map-draw-tools/test/map-draw-tools.e2e.js +24 -0
  33. package/dist/collection/components/map-draw-tools/test/map-draw-tools.spec.js +32 -0
  34. package/dist/collection/components/map-layer-picker/test/map-layer-picker.e2e.js +24 -0
  35. package/dist/collection/components/map-layer-picker/test/map-layer-picker.spec.js +109 -0
  36. package/dist/collection/components/map-search/test/map-search.e2e.js +24 -0
  37. package/dist/collection/components/map-search/test/map-search.spec.js +53 -0
  38. package/dist/collection/components/map-select-tools/map-select-tools.js +36 -36
  39. package/dist/collection/components/map-select-tools/test/map-select-tools.e2e.js +24 -0
  40. package/dist/collection/components/map-select-tools/test/map-select-tools.spec.js +349 -0
  41. package/dist/collection/components/media-card/test/media-card.e2e.js +24 -0
  42. package/dist/collection/components/media-card/test/media-card.spec.js +32 -0
  43. package/dist/collection/components/pci-calculator/test/pci-calculator.e2e.js +24 -0
  44. package/dist/collection/components/pci-calculator/test/pci-calculator.spec.js +32 -0
  45. package/dist/collection/components/pdf-download/test/pdf-download.e2e.js +71 -0
  46. package/dist/collection/components/pdf-download/test/pdf-download.spec.js +104 -0
  47. package/dist/collection/components/public-notification/test/public-notification.e2e.js +95 -0
  48. package/dist/collection/components/public-notification/test/public-notification.spec.js +149 -0
  49. package/dist/collection/components/refine-selection/refine-selection.css +85 -85
  50. package/dist/collection/components/solution-configuration/test/solution-configuration.e2e.js +31 -0
  51. package/dist/collection/components/solution-configuration/test/solution-configuration.spec.js +114 -0
  52. package/dist/collection/components/solution-contents/test/solution-contents.e2e.js +89 -0
  53. package/dist/collection/components/solution-contents/test/solution-contents.spec.js +138 -0
  54. package/dist/collection/components/solution-item/test/solution-item.e2e.js +31 -0
  55. package/dist/collection/components/solution-item/test/solution-item.spec.js +72 -0
  56. package/dist/collection/components/solution-item-details/test/solution-item-details.e2e.js +31 -0
  57. package/dist/collection/components/solution-item-details/test/solution-item-details.spec.js +137 -0
  58. package/dist/collection/components/solution-item-icon/test/solution-item-icon.e2e.js +24 -0
  59. package/dist/collection/components/solution-item-icon/test/solution-item-icon.spec.js +34 -0
  60. package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.e2e.js +31 -0
  61. package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.spec.js +49 -0
  62. package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.e2e.js +31 -0
  63. package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.spec.js +60 -0
  64. package/dist/collection/components/solution-resource-item/test/solution-resource-item.e2e.js +31 -0
  65. package/dist/collection/components/solution-resource-item/test/solution-resource-item.spec.js +50 -0
  66. package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.e2e.js +31 -0
  67. package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +170 -0
  68. package/dist/collection/components/solution-template-data/test/solution-template-data.e2e.js +31 -0
  69. package/dist/collection/components/solution-template-data/test/solution-template-data.spec.js +55 -0
  70. package/dist/collection/components/solution-variables/test/solution-variables.e2e.js +31 -0
  71. package/dist/collection/components/solution-variables/test/solution-variables.spec.js +126 -0
  72. package/dist/collection/utils/publicNotificationUtils.js +45 -0
  73. package/dist/collection/utils/templates.e2e.js +25 -0
  74. package/dist/collection/utils/test/csvUtils.spec.js +46 -0
  75. package/dist/collection/utils/test/downloadUtils.spec.js +102 -0
  76. package/dist/collection/utils/test/pciUtils.spec.js +297 -0
  77. package/dist/collection/utils/test/solution-store.spec.js +439 -0
  78. package/dist/components/map-select-tools2.js +36 -36
  79. package/dist/components/solution-store.js +3 -3
  80. package/dist/esm/calcite-input-text_5.entry.js +36 -36
  81. package/dist/esm/calcite-shell-panel_14.entry.js +1 -1
  82. package/dist/esm/solution-configuration.entry.js +1 -1
  83. package/dist/esm/solution-contents_3.entry.js +1 -1
  84. package/dist/esm/{solution-store-5d068b07.js → solution-store-70f874f8.js} +3 -3
  85. package/dist/solutions-components/{p-41802f6b.entry.js → p-16dfb254.entry.js} +1 -1
  86. package/dist/solutions-components/{p-4769a2a5.entry.js → p-5ed755a2.entry.js} +1 -1
  87. package/dist/solutions-components/{p-826a814d.js → p-78719506.js} +2 -2
  88. package/dist/solutions-components/{p-9f620303.entry.js → p-b4b19fd3.entry.js} +1 -1
  89. package/dist/solutions-components/{p-24fe6e1c.entry.js → p-d5d5942d.entry.js} +1 -1
  90. package/dist/solutions-components/solutions-components.esm.js +1 -1
  91. package/dist/solutions-components/utils/common.js +291 -0
  92. package/dist/solutions-components/utils/csvDownload.js +36 -0
  93. package/dist/solutions-components/utils/csvUtils.js +32 -0
  94. package/dist/solutions-components/utils/downloadUtils.js +386 -0
  95. package/dist/solutions-components/utils/interfaces.js +56 -0
  96. package/dist/solutions-components/utils/languageUtil.js +85 -0
  97. package/dist/solutions-components/utils/loadModules.js +20 -0
  98. package/dist/solutions-components/utils/locale.js +56 -0
  99. package/dist/solutions-components/utils/mapViewUtils.js +140 -0
  100. package/dist/solutions-components/utils/pciUtils.js +837 -0
  101. package/dist/solutions-components/utils/pdfUtils.js +62 -0
  102. package/dist/solutions-components/utils/publicNotificationStore.js +38 -0
  103. package/dist/solutions-components/utils/publicNotificationUtils.js +45 -0
  104. package/dist/solutions-components/utils/queryUtils.js +148 -0
  105. package/dist/solutions-components/utils/solution-store.js +579 -0
  106. package/dist/solutions-components/utils/templates.e2e.js +25 -0
  107. package/dist/solutions-components/utils/templates.js +341 -0
  108. package/dist/solutions-components/utils/test/csvUtils.spec.js +46 -0
  109. package/dist/solutions-components/utils/test/downloadUtils.spec.js +102 -0
  110. package/dist/solutions-components/utils/test/mocks/jsApi.js +74 -0
  111. package/dist/solutions-components/utils/test/pciUtils.spec.js +297 -0
  112. package/dist/solutions-components/utils/test/solution-store.spec.js +439 -0
  113. package/dist/solutions-components/utils/test/testUtils.js +135 -0
  114. package/dist/solutions-components/utils/types.js +14 -0
  115. package/dist/solutions-components_commit.txt +7 -0
  116. 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 (!forceUpdate) {
878
- this._sketchGraphic = graphics[0];
879
- }
880
- this._workflowType = this._useLayerFeaturesEnabled ? interfaces.EWorkflowType.SELECT : interfaces.EWorkflowType.SKETCH;
881
- if (this._workflowType === interfaces.EWorkflowType.SKETCH) {
882
- this._drawTools.updateGraphics();
883
- }
884
- this._updateLabel();
885
- this._clearSearchWidget();
886
- if (this._useLayerFeaturesEnabled && !forceUpdate) {
887
- const geometries = Array.isArray(graphics) && graphics.length > 0 && graphics[0] ? graphics.map(g => g.geometry) : this.geometries;
888
- await this._selectLayerFeatures(geometries[0]);
889
- }
890
- else {
891
- const oids = graphics.reduce((prev, cur) => {
892
- var _a;
893
- if ((_a = cur === null || cur === void 0 ? void 0 : cur.layer) === null || _a === void 0 ? void 0 : _a.objectIdField) {
894
- prev.push(cur.attributes[cur.layer.objectIdField]);
895
- }
896
- else if (cur.getObjectId) {
897
- prev.push(cur.getObjectId());
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
- if (this._sketchGraphic) {
1194
- void this._sketchGraphicsChanged({
1195
- detail: {
1196
- graphics: [this._sketchGraphic],
1197
- useOIDs: false
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-70002b57.js');
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-70002b57.js');
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-70002b57.js');
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.0 - Mon Aug 22 2022 11:29:01 GMT-0400 (Eastern Daylight Time)
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 === ">" || currentPos === len - 1) {
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 < len) {
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
+ });