@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
@@ -0,0 +1,34 @@
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 { SolutionItemIcon } from '../solution-item-icon';
18
+ import { value } from '../../../demos/data/solution-item-icon-data.json';
19
+ import { h } from '@stencil/core';
20
+ xdescribe('solution-item-icon', () => {
21
+ it('renders', async () => {
22
+ const page = await newSpecPage({
23
+ components: [SolutionItemIcon],
24
+ template: () => (h("solution-item-icon", { type: value.type, typeKeywords: value.typeKeywords }))
25
+ });
26
+ expect(page.root).toEqualHtml(`
27
+ <solution-item-icon>
28
+ <div title="Feature Service">
29
+ <img class="item-type-icon item-type-icon-margin" height="16" src="/item-icons/featureshosted16.png" width="16">
30
+ </div>
31
+ </solution-item-icon>
32
+ `);
33
+ });
34
+ });
@@ -0,0 +1,31 @@
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
+ describe('solution-item-sharing', () => {
18
+ it('renders', async () => {
19
+ //TEST commented out for now.
20
+ // need to work out how we pass translations
21
+ // e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
22
+ // could flatten the translations further so it would contain no sub groups
23
+ // could set default translations for each file
24
+ // and could still have a test to compare the default with the actual as a way to verify
25
+ expect("a").toEqual("a");
26
+ // const page = await newE2EPage();
27
+ // await page.setContent('<solution-item-sharing></solution-item-sharing>');
28
+ // const element = await page.find('solution-item-sharing');
29
+ // expect(element).toHaveClass('hydrated');
30
+ });
31
+ });
@@ -0,0 +1,49 @@
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 { SolutionItemSharing } from '../solution-item-sharing';
18
+ import { value } from '../../../demos/data/solution-item-sharing-data.json';
19
+ import { h } from '@stencil/core';
20
+ xdescribe('solution-item-sharing', () => {
21
+ it('renders', async () => {
22
+ const page = await newSpecPage({
23
+ components: [SolutionItemSharing],
24
+ template: () => (h("solution-item-sharing", { "group-id": value }))
25
+ });
26
+ expect(page.root).toEqualHtml(`
27
+ <solution-item-sharing>
28
+ <mock:shadow-root>
29
+ <div class="container-border">
30
+ <calcite-label layout="inline">
31
+ <calcite-switch id="A" name="setting" scale="m" switched="" value="enabled"></calcite-switch>
32
+ <solution-item-icon type="Feature Service"></solution-item-icon>
33
+ <span class="icon-text" title="ElectionGeography_public">
34
+ ElectionGeography_public
35
+ </span>
36
+ </calcite-label>
37
+ <calcite-label layout="inline">
38
+ <calcite-switch id="B" name="setting" scale="m" value="enabled"></calcite-switch>
39
+ <solution-item-icon type="Web Map"></solution-item-icon>
40
+ <span class="icon-text" title="Election Polling Places">
41
+ Election Polling Places
42
+ </span>
43
+ </calcite-label>
44
+ </div>
45
+ </mock:shadow-root>
46
+ </solution-item-sharing>
47
+ `);
48
+ });
49
+ });
@@ -0,0 +1,31 @@
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
+ describe('solution-organization-variables', () => {
18
+ it('renders', async () => {
19
+ //TEST commented out for now.
20
+ // need to work out how we pass translations
21
+ // e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
22
+ // could flatten the translations further so it would contain no sub groups
23
+ // could set default translations for each file
24
+ // and could still have a test to compare the default with the actual as a way to verify
25
+ expect("a").toEqual("a");
26
+ // const page = await newE2EPage();
27
+ // await page.setContent('<solution-organization-variables></solution-organization-variables>');
28
+ // const element = await page.find('solution-organization-variables');
29
+ // expect(element).toHaveClass('hydrated');
30
+ });
31
+ });
@@ -0,0 +1,60 @@
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 { SolutionOrganizationVariables } from '../solution-organization-variables';
18
+ import { value } from '../../../demos/data/solution-organization-variables-data.json';
19
+ import { h } from '@stencil/core';
20
+ xdescribe('solution-organization-variables', () => {
21
+ it('renders', async () => {
22
+ const page = await newSpecPage({
23
+ components: [SolutionOrganizationVariables],
24
+ template: () => (h("solution-organization-variables", { value: JSON.stringify(value) }))
25
+ });
26
+ expect(page.root).toEqualHtml(`
27
+ <solution-organization-variables>
28
+ <mock:shadow-root>
29
+ <div>
30
+ <h4 class="org-var-header">
31
+ Organization Variables
32
+ </h4>
33
+ </div>
34
+ <div class="container-border">
35
+ <calcite-label id="variable-label">
36
+ <calcite-tree-item>
37
+ title
38
+ </calcite-tree-item>
39
+ <calcite-tree-item>
40
+ title2
41
+ </calcite-tree-item>
42
+ <calcite-tree-item>
43
+ title3
44
+ </calcite-tree-item>
45
+ <calcite-tree-item>
46
+ title4
47
+ </calcite-tree-item>
48
+ <calcite-tree-item>
49
+ title5
50
+ </calcite-tree-item>
51
+ <calcite-tree-item>
52
+ title6
53
+ </calcite-tree-item>
54
+ </calcite-label>
55
+ </div>
56
+ </mock:shadow-root>
57
+ </solution-organization-variables>
58
+ `);
59
+ });
60
+ });
@@ -0,0 +1,31 @@
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
+ describe('solution-resource-item', () => {
18
+ it('renders', async () => {
19
+ //TEST commented out for now.
20
+ // need to work out how we pass translations
21
+ // e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
22
+ // could flatten the translations further so it would contain no sub groups
23
+ // could set default translations for each file
24
+ // and could still have a test to compare the default with the actual as a way to verify
25
+ expect("a").toEqual("a");
26
+ // const page = await newE2EPage();
27
+ // await page.setContent('<solution-resource-item></solution-resource-item>');
28
+ // const element = await page.find('solution-resource-item');
29
+ // expect(element).toHaveClass('hydrated');
30
+ });
31
+ });
@@ -0,0 +1,50 @@
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 { SolutionResourceItem } from '../solution-resource-item';
18
+ import { h } from '@stencil/core';
19
+ xdescribe('solution-resource-item', () => {
20
+ it('renders', async () => {
21
+ const page = await newSpecPage({
22
+ components: [SolutionResourceItem],
23
+ template: () => (h("solution-resource-item", null))
24
+ });
25
+ page.root.value = {
26
+ name: "thename",
27
+ url: "theurl"
28
+ };
29
+ await page.waitForChanges();
30
+ expect(page.root).toEqualHtml(`
31
+ <solution-resource-item itemid="">
32
+ <mock:shadow-root>
33
+ <div class="resource-item">
34
+ <div class="margin-bottom-1">
35
+ <calcite-button appearance="solid" class="resource-button" color="blue">
36
+ Add New Resource
37
+ </calcite-button>
38
+ <calcite-button appearance="solid" color="blue" disabled="">
39
+ Download All
40
+ </calcite-button>
41
+ </div>
42
+ <div class="resources-container" style="display: none;">
43
+ <calcite-value-list multiple=""></calcite-value-list>
44
+ </div>
45
+ </div>
46
+ </mock:shadow-root>
47
+ </solution-resource-item>
48
+ `);
49
+ });
50
+ });
@@ -0,0 +1,31 @@
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
+ describe('solution-spatial-ref', () => {
18
+ it('renders', async () => {
19
+ //TEST commented out for now.
20
+ // need to work out how we pass translations
21
+ // e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
22
+ // could flatten the translations further so it would contain no sub groups
23
+ // could set default translations for each file
24
+ // and could still have a test to compare the default with the actual as a way to verify
25
+ expect("a").toEqual("a");
26
+ // const page = await newE2EPage();
27
+ // await page.setContent('<solution-spatial-ref></solution-spatial-ref>');
28
+ // const element = await page.find('solution-spatial-ref');
29
+ // expect(element).toHaveClass('hydrated');
30
+ });
31
+ });
@@ -0,0 +1,170 @@
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 { SolutionSpatialRef } from '../solution-spatial-ref';
18
+ import { h } from '@stencil/core';
19
+ import state from "../../../utils/solution-store";
20
+ xdescribe('solution-spatial-ref', () => {
21
+ beforeEach(() => {
22
+ state._testAccess("_emptyTheStore");
23
+ state.setStoreInfo("spatialReferenceInfo", {
24
+ enabled: true,
25
+ services: {
26
+ "Feature Service 1": true,
27
+ "Feature Service 2": false
28
+ },
29
+ spatialReference: undefined
30
+ });
31
+ });
32
+ it('renders', async () => {
33
+ const page = await newSpecPage({
34
+ components: [SolutionSpatialRef],
35
+ supportsShadowDom: false,
36
+ template: () => (h("solution-spatial-ref", { services: ["Feature Service 1", "Feature Service 2"] }))
37
+ });
38
+ expect(page.root).toEqualHtml(`
39
+ <solution-spatial-ref default-wkid="102100" locked="">
40
+ <label class="switch-label"><calcite-switch scale="m" class="spatial-ref-switch"></calcite-switch>Spatial Reference Parameter</label>
41
+ <div id="spatialRefDefn" class="spatial-ref-switch-title">
42
+ <calcite-label>Select the spatial reference of the feature layers deployed with the solution.
43
+ <label class="spatial-ref-default">
44
+ <calcite-input disabled="" placeholder="Search for spatial reference using name or WKID"></calcite-input>
45
+ </label>
46
+ </calcite-label>
47
+ <div class="disabled-div">
48
+ <calcite-tree id="calcite-sr-tree" slot="children">
49
+ <div class="spatial-ref-container" id="solution-wkid-container">
50
+ <calcite-tree-item aria-selected="" id="102100" selected="">
51
+ <div>
52
+ WGS 1984 Web Mercator Auxiliary Sphere (102100)
53
+ </div>
54
+ </calcite-tree-item>
55
+ </div>
56
+ </calcite-tree>
57
+ </div>
58
+ <div>
59
+ <label class="spatial-ref-item-title">Feature Services</label>
60
+ <label class="switch-label"><calcite-switch disabled="" scale="m" switched="" class="spatial-ref-item-switch"></calcite-switch>Feature Service 1</label>
61
+ <label class="switch-label"><calcite-switch disabled="" scale="m" class="spatial-ref-item-switch"></calcite-switch>Feature Service 2</label>
62
+ </div>
63
+ </div>
64
+ </solution-spatial-ref>
65
+ `);
66
+ });
67
+ it('creates description for known WKID', async () => {
68
+ await newSpecPage({
69
+ components: [SolutionSpatialRef],
70
+ template: () => (h("solution-spatial-ref", null))
71
+ });
72
+ const component = document.querySelector('solution-spatial-ref');
73
+ component.wkidToDisplay(4326)
74
+ .then(result => expect(result).toEqual('GCS WGS 1984 (4326)'));
75
+ });
76
+ it('creates description for unknown WKID', async () => {
77
+ await newSpecPage({
78
+ components: [SolutionSpatialRef],
79
+ template: () => (h("solution-spatial-ref", null))
80
+ });
81
+ const component = document.querySelector('solution-spatial-ref');
82
+ component.wkidToDisplay(0)
83
+ .then(result => expect(result).toEqual('WKID 0'));
84
+ });
85
+ it('creates description for default component value', async () => {
86
+ await newSpecPage({
87
+ components: [SolutionSpatialRef],
88
+ template: () => (h("solution-spatial-ref", null))
89
+ });
90
+ const component = document.querySelector('solution-spatial-ref');
91
+ component.createSpatialRefDisplay(null)
92
+ .then(result => {
93
+ expect(result.display).toEqual('WGS 1984 Web Mercator Auxiliary Sphere (102100)');
94
+ expect(result.usingWkid).toBeTruthy();
95
+ expect(result.wkid).toEqual(102100);
96
+ expect(result.wkt).toEqual('');
97
+ });
98
+ });
99
+ it('creates description for WKID component value', async () => {
100
+ await newSpecPage({
101
+ components: [SolutionSpatialRef],
102
+ template: () => (h("solution-spatial-ref", null))
103
+ });
104
+ const component = document.querySelector('solution-spatial-ref');
105
+ component.createSpatialRefDisplay("4151")
106
+ .then(result => {
107
+ expect(result.display).toEqual('GCS Swiss TRF 1995 (4151)');
108
+ expect(result.usingWkid).toBeTruthy();
109
+ expect(result.wkid).toEqual(4151);
110
+ expect(result.wkt).toEqual('');
111
+ });
112
+ });
113
+ it('creates description for WKT component value', async () => {
114
+ await newSpecPage({
115
+ components: [SolutionSpatialRef],
116
+ template: () => (h("solution-spatial-ref", null))
117
+ });
118
+ const component = document.querySelector('solution-spatial-ref');
119
+ component.createSpatialRefDisplay('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]')
120
+ .then(result => {
121
+ expect(result.display).toEqual('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]');
122
+ expect(result.usingWkid).toBeFalsy();
123
+ expect(result.wkid).toEqual(0);
124
+ expect(result.wkt).toEqual('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]');
125
+ });
126
+ });
127
+ it('sets default component value', async () => {
128
+ await newSpecPage({
129
+ components: [SolutionSpatialRef],
130
+ template: () => (h("solution-spatial-ref", null))
131
+ });
132
+ const component = document.querySelector('solution-spatial-ref');
133
+ component.getSpatialRef()
134
+ .then(result => {
135
+ expect(result.display).toEqual('WGS 1984 Web Mercator Auxiliary Sphere (102100)');
136
+ expect(result.usingWkid).toBeTruthy();
137
+ expect(result.wkid).toEqual(102100);
138
+ expect(result.wkt).toEqual('');
139
+ });
140
+ });
141
+ it('sets WKID component value', async () => {
142
+ await newSpecPage({
143
+ components: [SolutionSpatialRef],
144
+ template: () => (h("solution-spatial-ref", { value: "4151" }))
145
+ });
146
+ const component = document.querySelector('solution-spatial-ref');
147
+ component.getSpatialRef()
148
+ .then(result => {
149
+ expect(result.display).toEqual('GCS Swiss TRF 1995 (4151)');
150
+ expect(result.usingWkid).toBeTruthy();
151
+ expect(result.wkid).toEqual(4151);
152
+ expect(result.wkt).toEqual('');
153
+ });
154
+ });
155
+ it('sets WKT component value', async () => {
156
+ const v = `PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]`;
157
+ await newSpecPage({
158
+ components: [SolutionSpatialRef],
159
+ template: () => (h("solution-spatial-ref", { value: v }))
160
+ });
161
+ const component = document.querySelector('solution-spatial-ref');
162
+ component.getSpatialRef()
163
+ .then(result => {
164
+ expect(result.display).toEqual('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]');
165
+ expect(result.usingWkid).toBeFalsy();
166
+ expect(result.wkid).toEqual(0);
167
+ expect(result.wkt).toEqual('PROJCS["Germany_Zone_5",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",5500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]');
168
+ });
169
+ });
170
+ });
@@ -0,0 +1,31 @@
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
+ describe('solution-template-data', () => {
18
+ it('renders', async () => {
19
+ //TEST commented out for now.
20
+ // need to work out how we pass translations
21
+ // e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
22
+ // could flatten the translations further so it would contain no sub groups
23
+ // could set default translations for each file
24
+ // and could still have a test to compare the default with the actual as a way to verify
25
+ expect("a").toEqual("a");
26
+ // const page = await newE2EPage();
27
+ // await page.setContent('<solution-template-data></solution-template-data>');
28
+ // const element = await page.find('solution-template-data');
29
+ // expect(element).toHaveClass('hydrated');
30
+ });
31
+ });
@@ -0,0 +1,55 @@
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 { SolutionTemplateData } from '../solution-template-data';
18
+ import * as data from '../../../demos/data/solution-template-data-data.json';
19
+ import { h } from '@stencil/core';
20
+ import state from "../../../utils/solution-store";
21
+ beforeEach(async () => {
22
+ state._testAccess("_emptyTheStore");
23
+ });
24
+ xdescribe('solution-template-data', () => {
25
+ it('renders', async () => {
26
+ const page = await newSpecPage({
27
+ components: [SolutionTemplateData],
28
+ template: () => (h("solution-template-data", { "item-id": data }))
29
+ });
30
+ expect(page.root).toEqualHtml(`
31
+ <solution-template-data instanceid="" itemid="" vars-open="">
32
+ <div class="solution-data-container">
33
+ <calcite-shell class="light var-container" dir="ltr">
34
+ <calcite-panel class="json-editor">
35
+ <div class="calcite-match-height solution-data-child-container">
36
+ <json-editor instanceid="" value=""></json-editor>
37
+ </div>
38
+ </calcite-panel>
39
+ <calcite-shell-panel height-scale="l" position="end" slot="contextual-panel" width-scale="xs">
40
+ <div class="solution-data-child-container">
41
+ <calcite-button appearance="transparent" class="collapse-btn" icon-start="chevrons-right" id="collapse-vars" scale="s" title="Cancel Edits"></calcite-button>
42
+ <div class="org-vars" id="orgVars">
43
+ <solution-organization-variables></solution-organization-variables>
44
+ </div>
45
+ <div class="sol-vars" id="solVars">
46
+ <solution-variables></solution-variables>
47
+ </div>
48
+ </div>
49
+ </calcite-shell-panel>
50
+ </calcite-shell>
51
+ </div>
52
+ </solution-template-data>
53
+ `);
54
+ });
55
+ });
@@ -0,0 +1,31 @@
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
+ describe('solution-variables', () => {
18
+ it('renders', async () => {
19
+ //TEST commented out for now.
20
+ // need to work out how we pass translations
21
+ // e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
22
+ // could flatten the translations further so it would contain no sub groups
23
+ // could set default translations for each file
24
+ // and could still have a test to compare the default with the actual as a way to verify
25
+ expect("a").toEqual("a");
26
+ // const page = await newE2EPage();
27
+ // await page.setContent('<solution-variables></solution-variables>');
28
+ // const element = await page.find('solution-variables');
29
+ // expect(element).toHaveClass('hydrated');
30
+ });
31
+ });