@rancher/shell 3.0.12-rc.2 → 3.0.12-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/impl/apis.ts +6 -0
- package/apis/index.ts +26 -0
- package/apis/intf/resources-api/cluster-api.ts +18 -0
- package/apis/intf/resources-api/mgmt-api.ts +15 -0
- package/apis/intf/resources-api/resource-base.ts +107 -0
- package/apis/intf/resources-api/resource-constants.ts +147 -0
- package/apis/intf/resources-api/resources-api.ts +143 -0
- package/apis/intf/resources.ts +49 -0
- package/apis/intf/{modal.ts → shell-api/modal.ts} +21 -26
- package/apis/intf/shell-api/proxy.ts +216 -0
- package/apis/intf/{slide-in.ts → shell-api/slide-in.ts} +4 -3
- package/apis/intf/{system.ts → shell-api/system.ts} +4 -1
- package/apis/intf/shell.ts +12 -6
- package/apis/resources/__tests__/resources-api-class.test.ts +550 -0
- package/apis/resources/index.ts +22 -0
- package/apis/resources/resources-api-class.ts +187 -0
- package/apis/shell/__tests__/proxy.test.ts +369 -0
- package/apis/shell/index.ts +8 -1
- package/apis/shell/modal.ts +4 -1
- package/apis/shell/notifications.ts +9 -6
- package/apis/shell/proxy.ts +256 -0
- package/apis/shell/slide-in.ts +4 -1
- package/apis/vue-shim.d.ts +2 -1
- package/assets/data/aws-regions.json +4 -0
- package/assets/fonts/lato/LatoLatin-Black.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Black.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-BlackItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-BlackItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Bold.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Bold.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-BoldItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-BoldItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Heavy.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Heavy.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-HeavyItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-HeavyItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Italic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Italic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Light.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Light.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-LightItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-LightItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Medium.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Medium.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-MediumItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-MediumItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Regular.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Regular.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Semibold.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Semibold.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-SemiboldItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-SemiboldItalic.woff2 +0 -0
- package/assets/styles/base/_variables.scss +2 -0
- package/assets/styles/fonts/_fontstack.scss +132 -8
- package/assets/translations/en-us.yaml +22 -5
- package/chart/monitoring/index.vue +10 -1
- package/components/ActionDropdownShell.vue +2 -1
- package/components/CruResourceFooter.vue +9 -5
- package/components/ExplorerProjectsNamespaces.vue +1 -1
- package/components/InstallHelmCharts.vue +2 -2
- package/components/LandingPagePreference.vue +14 -5
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +15 -1
- package/components/Resource/Detail/Metadata/index.vue +6 -0
- package/components/Resource/Detail/ResourcePopover/index.vue +12 -1
- package/components/Resource/Detail/SpacedRow.vue +3 -1
- package/components/Resource/Detail/TitleBar/index.vue +10 -11
- package/components/ResourceList/Masthead.vue +12 -8
- package/components/SelectIconGrid.vue +0 -10
- package/components/SingleClusterInfo.vue +1 -0
- package/components/SortableTable/__tests__/sorting.test.ts +126 -0
- package/components/SortableTable/index.vue +6 -9
- package/components/SortableTable/selection.js +23 -5
- package/components/SortableTable/sorting.js +6 -3
- package/components/Wizard.vue +14 -13
- package/components/fleet/FleetBundles.vue +100 -12
- package/components/fleet/FleetClusterTargets/index.vue +37 -15
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +149 -115
- package/components/fleet/__tests__/FleetClusters.test.ts +12 -12
- package/components/form/LabeledSelect.vue +20 -3
- package/components/form/NameNsDescription.vue +11 -0
- package/components/form/Security.vue +6 -2
- package/components/form/WorkloadPorts.vue +2 -7
- package/components/form/__tests__/Security.test.ts +76 -0
- package/components/formatter/Autoscaler.vue +4 -4
- package/components/formatter/ClusterKubeVersion.vue +27 -0
- package/components/formatter/ClusterLink.vue +1 -7
- package/components/formatter/ClusterProvider.vue +6 -10
- package/components/formatter/FleetSummaryGraph.vue +0 -3
- package/components/formatter/MachineSummaryGraph.vue +1 -1
- package/components/formatter/PodsUsage.vue +2 -2
- package/components/formatter/__tests__/Autoscaler.test.ts +19 -22
- package/components/formatter/__tests__/FleetSummaryGraph.test.ts +216 -0
- package/components/formatter/__tests__/PodsUsage.test.ts +6 -10
- package/components/nav/NamespaceFilter.vue +2 -2
- package/components/nav/TopLevelMenu.helper.ts +15 -3
- package/components/nav/TopLevelMenu.vue +16 -5
- package/components/nav/__tests__/TopLevelMenu.test.ts +145 -21
- package/components/templates/home.vue +18 -0
- package/components/templates/plain.vue +18 -0
- package/components/templates/standalone.vue +17 -0
- package/composables/useFormValidation.ts +93 -0
- package/composables/useVeeValidateField.test.ts +159 -0
- package/composables/useVeeValidateField.ts +67 -0
- package/config/pagination-table-headers.js +18 -1
- package/config/product/manager.js +82 -21
- package/config/router/routes.js +6 -0
- package/config/table-headers.js +20 -1
- package/config/types.js +2 -1
- package/core/__tests__/plugin-products.test.ts +904 -20
- package/core/plugin-products-base.ts +107 -7
- package/core/plugin-products.ts +4 -0
- package/core/plugin-types.ts +111 -1
- package/core/plugin.ts +15 -7
- package/core/productDebugger.js +9 -4
- package/core/types-provisioning.ts +43 -30
- package/core/types.ts +57 -20
- package/detail/__tests__/pod.test.ts +41 -0
- package/detail/harvesterhci.io.management.cluster.vue +6 -2
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +4 -10
- package/edit/auth/__tests__/azuread.test.ts +217 -34
- package/edit/auth/azuread.vue +122 -14
- package/edit/auth/oidc.vue +2 -2
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +13 -4
- package/edit/networking.k8s.io.ingress/RulePath.vue +8 -4
- package/edit/networking.k8s.io.ingress/index.vue +75 -20
- package/edit/provisioning.cattle.io.cluster/__tests__/MachinePool.test.ts +104 -0
- package/edit/provisioning.cattle.io.cluster/index.vue +11 -7
- package/edit/provisioning.cattle.io.cluster/rke2.vue +8 -4
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +11 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +37 -4
- package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +132 -7
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +2 -1
- package/edit/secret/__tests__/ssh.test.ts +5 -6
- package/edit/secret/basic.vue +31 -0
- package/edit/secret/index.vue +68 -17
- package/edit/secret/registry.vue +38 -0
- package/edit/secret/ssh.vue +29 -0
- package/edit/secret/tls.vue +30 -0
- package/edit/service.vue +4 -4
- package/edit/workload/Upgrading.vue +3 -3
- package/edit/workload/__tests__/Upgrading.test.ts +6 -9
- package/edit/workload/mixins/workload.js +2 -1
- package/list/fleet.cattle.io.bundle.vue +7 -104
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +20 -0
- package/list/provisioning.cattle.io.cluster.vue +262 -180
- package/list/utils/management.cattle.io.cluster.utils.ts +128 -0
- package/mixins/__tests__/chart.test.ts +112 -0
- package/mixins/brand.js +2 -1
- package/mixins/chart.js +12 -8
- package/mixins/resource-fetch-api-pagination.js +41 -5
- package/models/__tests__/ext.cattle.io.kubeconfig.test.ts +67 -67
- package/models/__tests__/management.cattle.io.cluster.test.ts +1 -1
- package/models/__tests__/management.cattle.io.node.ts +6 -5
- package/models/__tests__/management.cattle.io.nodepool.ts +5 -4
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +32 -11
- package/models/base-cluster.x-k8s.io.js +26 -0
- package/models/cluster.js +1 -1
- package/models/cluster.x-k8s.io.machine.js +4 -22
- package/models/cluster.x-k8s.io.machinedeployment.js +2 -20
- package/models/cluster.x-k8s.io.machineset.js +2 -20
- package/models/compliance.cattle.io.clusterscan.js +130 -2
- package/models/ext.cattle.io.kubeconfig.ts +4 -7
- package/models/fleet-application.js +3 -1
- package/models/management.cattle.io.cluster.js +417 -40
- package/models/management.cattle.io.node.js +6 -4
- package/models/management.cattle.io.nodepool.js +1 -1
- package/models/networking.k8s.io.ingress.js +12 -4
- package/models/provisioning.cattle.io.cluster.js +47 -330
- package/models/rke.cattle.io.etcdsnapshot.js +1 -2
- package/package.json +11 -29
- package/pages/__tests__/readme.test.ts +49 -0
- package/pages/auth/setup.vue +2 -3
- package/pages/c/_cluster/apps/charts/__tests__/chart.test.ts +76 -0
- package/pages/c/_cluster/apps/charts/chart.vue +60 -8
- package/pages/c/_cluster/apps/charts/install.vue +10 -7
- package/pages/c/_cluster/explorer/__tests__/index.test.ts +23 -25
- package/pages/c/_cluster/explorer/index.vue +5 -49
- package/pages/c/_cluster/istio/__tests__/istio.index.test.ts +194 -0
- package/pages/c/_cluster/istio/index.vue +21 -6
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -0
- package/pages/c/_cluster/uiplugins/__tests__/index.test.ts +719 -2
- package/pages/c/_cluster/uiplugins/index.vue +203 -197
- package/pages/diagnostic.vue +13 -17
- package/pages/fail-whale.vue +18 -0
- package/pages/home.vue +77 -260
- package/pages/readme.vue +88 -0
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +88 -0
- package/plugins/dashboard-store/actions.js +40 -18
- package/plugins/dashboard-store/resource-class.js +5 -2
- package/plugins/steve/__tests__/subscribe.spec.ts +6 -3
- package/plugins/steve/steve-pagination-utils.ts +11 -3
- package/plugins/steve/subscribe.js +35 -5
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +10 -4
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +7 -52
- package/rancher-components/RcButton/RcButton.test.ts +37 -1
- package/rancher-components/RcButton/RcButton.vue +38 -8
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +10 -8
- package/store/__tests__/catalog.test.ts +115 -1
- package/store/__tests__/type-map.test.ts +556 -1
- package/store/action-menu.js +8 -3
- package/store/auth.js +1 -1
- package/store/aws.js +27 -16
- package/store/catalog.js +27 -3
- package/store/digitalocean.js +20 -38
- package/store/index.js +2 -0
- package/store/linode.js +25 -40
- package/store/pnap.js +1 -0
- package/store/type-map.js +111 -29
- package/tsconfig.paths.json +8 -8
- package/types/kube/kube-api.ts +14 -1
- package/types/rancher/steve.api.ts +12 -12
- package/types/resources/settings.d.ts +2 -1
- package/types/shell/index.d.ts +102 -2
- package/types/store/dashboard-store.types.ts +108 -11
- package/types/store/pagination.types.ts +6 -3
- package/utils/__tests__/alertmanagerconfig.test.ts +117 -0
- package/utils/__tests__/async.test.ts +87 -0
- package/utils/__tests__/aws.test.ts +140 -0
- package/utils/__tests__/banners.test.ts +176 -0
- package/utils/__tests__/chart.test.ts +64 -1
- package/utils/__tests__/color.test.ts +226 -0
- package/utils/__tests__/duration.test.ts +140 -0
- package/utils/__tests__/fleet.test.ts +340 -0
- package/utils/__tests__/ingress.test.ts +553 -0
- package/utils/__tests__/kube.test.ts +68 -0
- package/utils/__tests__/namespace-filter.test.ts +109 -0
- package/utils/__tests__/pagination-utils.test.ts +361 -0
- package/utils/__tests__/parse-externalid.test.ts +137 -0
- package/utils/__tests__/perf-setting.utils.test.ts +98 -0
- package/utils/__tests__/poller-sequential.test.ts +177 -0
- package/utils/__tests__/poller.test.ts +170 -0
- package/utils/__tests__/promise.test.ts +346 -0
- package/utils/__tests__/settings.test.ts +140 -0
- package/utils/__tests__/sort-utils.test.ts +301 -0
- package/utils/__tests__/string-utils.test.ts +798 -0
- package/utils/__tests__/string.test.ts +23 -1
- package/utils/__tests__/style.test.ts +154 -0
- package/utils/__tests__/svg-filter.test.ts +184 -0
- package/utils/__tests__/units.test.ts +417 -0
- package/utils/__tests__/versions.test.ts +128 -0
- package/utils/__tests__/xccdf.test.ts +391 -0
- package/utils/chart.js +36 -0
- package/utils/fleet.ts +13 -3
- package/utils/gatekeeper/__tests__/util.test.ts +174 -0
- package/utils/gc/__tests__/gc-interval.test.ts +119 -0
- package/utils/gc/__tests__/gc-root-store.test.ts +225 -0
- package/utils/gc/__tests__/gc-route-changed.test.ts +96 -0
- package/utils/gc/__tests__/gc.test.ts +487 -0
- package/utils/ingress.ts +9 -1
- package/utils/pagination-utils.ts +2 -1
- package/utils/string.js +25 -2
- package/utils/uiplugins.ts +5 -5
- package/utils/validators/__tests__/cluster-name.test.ts +110 -0
- package/utils/validators/__tests__/cron-schedule.test.ts +79 -0
- package/utils/validators/__tests__/index.test.ts +481 -0
- package/utils/validators/__tests__/kubernetes-name.test.ts +163 -0
- package/utils/validators/__tests__/misc-validators.test.ts +246 -0
- package/utils/validators/__tests__/pod-affinity.test.ts +382 -0
- package/utils/validators/__tests__/prometheusrule.test.ts +211 -0
- package/utils/validators/__tests__/role-template.test.ts +149 -0
- package/utils/validators/__tests__/service.test.ts +283 -0
- package/utils/validators/__tests__/setting.test.js +32 -0
- package/utils/validators/formRules/__tests__/index.test.ts +50 -0
- package/utils/validators/formRules/index.ts +5 -5
- package/utils/validators/machine-pool.ts +1 -1
- package/utils/validators/setting.js +18 -3
- package/utils/xccdf.ts +418 -0
- package/assets/fonts/lato/lato-v17-latin-700.woff +0 -0
- package/assets/fonts/lato/lato-v17-latin-700.woff2 +0 -0
- package/assets/fonts/lato/lato-v17-latin-regular.woff +0 -0
- package/assets/fonts/lato/lato-v17-latin-regular.woff2 +0 -0
|
@@ -4,54 +4,18 @@ import FleetClusterTargets from '@shell/components/fleet/FleetClusterTargets/ind
|
|
|
4
4
|
import { _CREATE, _EDIT } from '@shell/config/query-params';
|
|
5
5
|
import { Selector } from '@shell/types/fleet';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const mockedStore = () => {
|
|
8
8
|
return {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'cluster/all': () => [],
|
|
14
|
-
'management/all': () => [],
|
|
15
|
-
'management/byId': () => () => ({}),
|
|
16
|
-
'i18n/t': () => '',
|
|
17
|
-
'i18n/withFallback': () => '',
|
|
18
|
-
currentStore: () => 'current_store',
|
|
19
|
-
'current_store/all': () => [],
|
|
20
|
-
'current_store/inStore': () => 'current_store',
|
|
21
|
-
'prefs/theme': () => 'light',
|
|
22
|
-
'prefs/get': () => false,
|
|
23
|
-
'features/get': () => false
|
|
24
|
-
},
|
|
25
|
-
dispatch: () => {}
|
|
26
|
-
},
|
|
27
|
-
$router: {
|
|
28
|
-
resolve: () => ({ href: '' }),
|
|
29
|
-
push: () => {},
|
|
30
|
-
replace: () => {}
|
|
31
|
-
},
|
|
32
|
-
$route: {
|
|
33
|
-
query: {},
|
|
34
|
-
hash: ''
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
stubs: {
|
|
38
|
-
'router-link': { template: '<a><slot /></a>' },
|
|
39
|
-
'n-link': { template: '<a><slot /></a>' },
|
|
40
|
-
'nuxt-link': { template: '<a><slot /></a>' },
|
|
41
|
-
FleetTargetsList: { template: '<div class="fleet-targets-list-stub"><slot /></div>' }
|
|
42
|
-
}
|
|
43
|
-
}
|
|
9
|
+
getters: {
|
|
10
|
+
'i18n/t': (text: string) => text,
|
|
11
|
+
'features/get': () => false,
|
|
12
|
+
},
|
|
44
13
|
};
|
|
45
|
-
}
|
|
14
|
+
};
|
|
46
15
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return mount(component, {
|
|
51
|
-
...options,
|
|
52
|
-
...setup
|
|
53
|
-
});
|
|
54
|
-
}
|
|
16
|
+
const requiredSetup = () => {
|
|
17
|
+
return { global: { mocks: { $store: mockedStore() } } };
|
|
18
|
+
};
|
|
55
19
|
|
|
56
20
|
describe('component: FleetClusterTargets', () => {
|
|
57
21
|
describe('mode: edit', () => {
|
|
@@ -63,7 +27,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
63
27
|
clusterName: 'fleet-5-france',
|
|
64
28
|
clusterSelector: { matchLabels: { foo: 'true' } }
|
|
65
29
|
};
|
|
66
|
-
const wrapper =
|
|
30
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
31
|
+
...requiredSetup(),
|
|
67
32
|
props: {
|
|
68
33
|
targets: [target1],
|
|
69
34
|
namespace: 'fleet-default',
|
|
@@ -91,7 +56,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
91
56
|
}]
|
|
92
57
|
}
|
|
93
58
|
};
|
|
94
|
-
const wrapper =
|
|
59
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
60
|
+
...requiredSetup(),
|
|
95
61
|
props: {
|
|
96
62
|
targets: [target1],
|
|
97
63
|
namespace: 'fleet-default',
|
|
@@ -113,7 +79,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
113
79
|
|
|
114
80
|
const target2 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
115
81
|
|
|
116
|
-
const wrapper =
|
|
82
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
83
|
+
...requiredSetup(),
|
|
117
84
|
props: {
|
|
118
85
|
targets: [target1, target2],
|
|
119
86
|
namespace: 'fleet-default',
|
|
@@ -138,7 +105,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
138
105
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
139
106
|
const target2 = { clusterSelector: { matchLabels: { hci: 'true' } } };
|
|
140
107
|
|
|
141
|
-
const wrapper =
|
|
108
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
109
|
+
...requiredSetup(),
|
|
142
110
|
props: {
|
|
143
111
|
targets: [target1, target2],
|
|
144
112
|
namespace: 'fleet-default',
|
|
@@ -166,7 +134,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
166
134
|
it('should set targetMode to "advanced" and return early if clusterGroupSelector is present', () => {
|
|
167
135
|
const target1 = { clusterGroupSelector: {} };
|
|
168
136
|
|
|
169
|
-
const wrapper =
|
|
137
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
138
|
+
...requiredSetup(),
|
|
170
139
|
props: {
|
|
171
140
|
targets: [target1],
|
|
172
141
|
namespace: 'fleet-default',
|
|
@@ -207,7 +176,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
207
176
|
name: 'tt1',
|
|
208
177
|
};
|
|
209
178
|
|
|
210
|
-
const wrapper =
|
|
179
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
180
|
+
...requiredSetup(),
|
|
211
181
|
props: {
|
|
212
182
|
targets: [target1],
|
|
213
183
|
namespace: 'fleet-default',
|
|
@@ -226,7 +196,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
226
196
|
});
|
|
227
197
|
|
|
228
198
|
it('should return early and not modify state if targets is empty', () => {
|
|
229
|
-
const wrapper =
|
|
199
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
200
|
+
...requiredSetup(),
|
|
230
201
|
props: {
|
|
231
202
|
targets: [],
|
|
232
203
|
namespace: 'fleet-default',
|
|
@@ -245,7 +216,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
245
216
|
|
|
246
217
|
it('should return targetMode local if namespace is fleet-local', () => {
|
|
247
218
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
248
|
-
const wrapper =
|
|
219
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
220
|
+
...requiredSetup(),
|
|
249
221
|
props: {
|
|
250
222
|
targets: [target1],
|
|
251
223
|
namespace: 'fleet-local',
|
|
@@ -261,7 +233,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
261
233
|
it('should handle targets with multiple clusterName', () => {
|
|
262
234
|
const target1 = { clusterName: 'prod-cluster' };
|
|
263
235
|
const target2 = { clusterName: 'test-cluster' };
|
|
264
|
-
const wrapper =
|
|
236
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
237
|
+
...requiredSetup(),
|
|
265
238
|
props: {
|
|
266
239
|
targets: [target1, target2],
|
|
267
240
|
namespace: 'fleet-default',
|
|
@@ -293,7 +266,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
293
266
|
}
|
|
294
267
|
};
|
|
295
268
|
|
|
296
|
-
const wrapper =
|
|
269
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
270
|
+
...requiredSetup(),
|
|
297
271
|
props: {
|
|
298
272
|
targets: [target1],
|
|
299
273
|
namespace: 'fleet-default',
|
|
@@ -321,7 +295,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
321
295
|
it('should correctly process targets when targetMode is "all" and no clusterName or clusterSelector is present', () => {
|
|
322
296
|
const target1 = { name: 'simple-target' };
|
|
323
297
|
|
|
324
|
-
const wrapper =
|
|
298
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
299
|
+
...requiredSetup(),
|
|
325
300
|
props: {
|
|
326
301
|
targets: [target1],
|
|
327
302
|
namespace: 'fleet-default',
|
|
@@ -350,7 +325,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
350
325
|
name: 'simple-target'
|
|
351
326
|
};
|
|
352
327
|
|
|
353
|
-
const wrapper =
|
|
328
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
329
|
+
...requiredSetup(),
|
|
354
330
|
props: {
|
|
355
331
|
targets: [target1],
|
|
356
332
|
namespace: 'fleet-default',
|
|
@@ -374,7 +350,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
374
350
|
clusterName: 'fleet-5-france',
|
|
375
351
|
clusterSelector: { matchLabels: { foo: 'true' } }
|
|
376
352
|
};
|
|
377
|
-
const wrapper =
|
|
353
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
354
|
+
...requiredSetup(),
|
|
378
355
|
props: {
|
|
379
356
|
targets: [target1],
|
|
380
357
|
namespace: 'fleet-default',
|
|
@@ -399,7 +376,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
399
376
|
}]
|
|
400
377
|
}
|
|
401
378
|
};
|
|
402
|
-
const wrapper =
|
|
379
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
380
|
+
...requiredSetup(),
|
|
403
381
|
props: {
|
|
404
382
|
targets: [target1],
|
|
405
383
|
namespace: 'fleet-default',
|
|
@@ -424,7 +402,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
424
402
|
|
|
425
403
|
const target2 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
426
404
|
|
|
427
|
-
const wrapper =
|
|
405
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
406
|
+
...requiredSetup(),
|
|
428
407
|
props: {
|
|
429
408
|
targets: [target1, target2],
|
|
430
409
|
namespace: 'fleet-default',
|
|
@@ -442,7 +421,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
442
421
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
443
422
|
const target2 = { clusterSelector: { matchLabels: { hci: 'true' } } };
|
|
444
423
|
|
|
445
|
-
const wrapper =
|
|
424
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
425
|
+
...requiredSetup(),
|
|
446
426
|
props: {
|
|
447
427
|
targets: [target1, target2],
|
|
448
428
|
namespace: 'fleet-default',
|
|
@@ -459,7 +439,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
459
439
|
it('should emit advanced cases untouched', async() => {
|
|
460
440
|
const target1 = { clusterGroupSelector: {} };
|
|
461
441
|
|
|
462
|
-
const wrapper =
|
|
442
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
443
|
+
...requiredSetup(),
|
|
463
444
|
props: {
|
|
464
445
|
targets: [target1],
|
|
465
446
|
namespace: 'fleet-default',
|
|
@@ -496,7 +477,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
496
477
|
name: 'tt1',
|
|
497
478
|
};
|
|
498
479
|
|
|
499
|
-
const wrapper =
|
|
480
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
481
|
+
...requiredSetup(),
|
|
500
482
|
props: {
|
|
501
483
|
targets: [target1],
|
|
502
484
|
namespace: 'fleet-default',
|
|
@@ -527,7 +509,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
527
509
|
});
|
|
528
510
|
|
|
529
511
|
it('should emit harvester rule from empty targets source', async() => {
|
|
530
|
-
const wrapper =
|
|
512
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
513
|
+
...requiredSetup(),
|
|
531
514
|
props: {
|
|
532
515
|
targets: [], // targetMode === 'none'
|
|
533
516
|
namespace: 'fleet-default',
|
|
@@ -544,7 +527,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
544
527
|
it('should emit untouched targets from source when operating in fleet-local workspace', async() => {
|
|
545
528
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
546
529
|
|
|
547
|
-
const wrapper =
|
|
530
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
531
|
+
...requiredSetup(),
|
|
548
532
|
props: {
|
|
549
533
|
targets: [target1],
|
|
550
534
|
namespace: 'fleet-local',
|
|
@@ -573,7 +557,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
573
557
|
}
|
|
574
558
|
};
|
|
575
559
|
|
|
576
|
-
const wrapper =
|
|
560
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
561
|
+
...requiredSetup(),
|
|
577
562
|
props: {
|
|
578
563
|
targets: [target1],
|
|
579
564
|
namespace: 'fleet-default',
|
|
@@ -596,7 +581,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
596
581
|
it('should emit targets excluding target names and adding harvester rule', async() => {
|
|
597
582
|
const target1 = { name: 'simple-target' };
|
|
598
583
|
|
|
599
|
-
const wrapper =
|
|
584
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
585
|
+
...requiredSetup(),
|
|
600
586
|
props: {
|
|
601
587
|
targets: [target1],
|
|
602
588
|
namespace: 'fleet-default',
|
|
@@ -628,7 +614,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
628
614
|
name: 'simple-target'
|
|
629
615
|
};
|
|
630
616
|
|
|
631
|
-
const wrapper =
|
|
617
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
618
|
+
...requiredSetup(),
|
|
632
619
|
props: {
|
|
633
620
|
targets: [target1],
|
|
634
621
|
namespace: 'fleet-default',
|
|
@@ -659,7 +646,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
659
646
|
clusterName: 'fleet-5-france',
|
|
660
647
|
clusterSelector: { matchLabels: { foo: 'true' } }
|
|
661
648
|
};
|
|
662
|
-
const wrapper =
|
|
649
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
650
|
+
...requiredSetup(),
|
|
663
651
|
props: {
|
|
664
652
|
targets: [target1],
|
|
665
653
|
namespace: 'fleet-default',
|
|
@@ -688,7 +676,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
688
676
|
}]
|
|
689
677
|
}
|
|
690
678
|
};
|
|
691
|
-
const wrapper =
|
|
679
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
680
|
+
...requiredSetup(),
|
|
692
681
|
props: {
|
|
693
682
|
targets: [target1],
|
|
694
683
|
namespace: 'fleet-default',
|
|
@@ -710,7 +699,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
710
699
|
|
|
711
700
|
const target2 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
712
701
|
|
|
713
|
-
const wrapper =
|
|
702
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
703
|
+
...requiredSetup(),
|
|
714
704
|
props: {
|
|
715
705
|
targets: [target1, target2],
|
|
716
706
|
namespace: 'fleet-default',
|
|
@@ -736,7 +726,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
736
726
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
737
727
|
const target2 = { clusterSelector: { matchLabels: { hci: 'true' } } };
|
|
738
728
|
|
|
739
|
-
const wrapper =
|
|
729
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
730
|
+
...requiredSetup(),
|
|
740
731
|
props: {
|
|
741
732
|
targets: [target1, target2],
|
|
742
733
|
namespace: 'fleet-default',
|
|
@@ -765,7 +756,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
765
756
|
it('should set targetMode to "advanced" and return early if clusterGroupSelector is present', () => {
|
|
766
757
|
const target1 = { clusterGroupSelector: {} };
|
|
767
758
|
|
|
768
|
-
const wrapper =
|
|
759
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
760
|
+
...requiredSetup(),
|
|
769
761
|
props: {
|
|
770
762
|
targets: [target1],
|
|
771
763
|
namespace: 'fleet-default',
|
|
@@ -807,7 +799,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
807
799
|
name: 'tt1',
|
|
808
800
|
};
|
|
809
801
|
|
|
810
|
-
const wrapper =
|
|
802
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
803
|
+
...requiredSetup(),
|
|
811
804
|
props: {
|
|
812
805
|
targets: [target1],
|
|
813
806
|
namespace: 'fleet-default',
|
|
@@ -827,7 +820,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
827
820
|
});
|
|
828
821
|
|
|
829
822
|
it('should return early and not modify state if targets is empty', () => {
|
|
830
|
-
const wrapper =
|
|
823
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
824
|
+
...requiredSetup(),
|
|
831
825
|
props: {
|
|
832
826
|
targets: [],
|
|
833
827
|
namespace: 'fleet-default',
|
|
@@ -847,7 +841,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
847
841
|
|
|
848
842
|
it('should return targetMode local if namespace is fleet-local', () => {
|
|
849
843
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
850
|
-
const wrapper =
|
|
844
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
845
|
+
...requiredSetup(),
|
|
851
846
|
props: {
|
|
852
847
|
targets: [target1],
|
|
853
848
|
namespace: 'fleet-local',
|
|
@@ -864,7 +859,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
864
859
|
it('should handle targets with multiple clusterName', () => {
|
|
865
860
|
const target1 = { clusterName: 'prod-cluster' };
|
|
866
861
|
const target2 = { clusterName: 'test-cluster' };
|
|
867
|
-
const wrapper =
|
|
862
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
863
|
+
...requiredSetup(),
|
|
868
864
|
props: {
|
|
869
865
|
targets: [target1, target2],
|
|
870
866
|
namespace: 'fleet-default',
|
|
@@ -897,7 +893,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
897
893
|
}
|
|
898
894
|
};
|
|
899
895
|
|
|
900
|
-
const wrapper =
|
|
896
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
897
|
+
...requiredSetup(),
|
|
901
898
|
props: {
|
|
902
899
|
targets: [target1],
|
|
903
900
|
namespace: 'fleet-default',
|
|
@@ -926,7 +923,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
926
923
|
it('should correctly process targets when targetMode is "all" and no clusterName or clusterSelector is present', () => {
|
|
927
924
|
const target1 = { name: 'simple-target' };
|
|
928
925
|
|
|
929
|
-
const wrapper =
|
|
926
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
927
|
+
...requiredSetup(),
|
|
930
928
|
props: {
|
|
931
929
|
targets: [target1],
|
|
932
930
|
namespace: 'fleet-default',
|
|
@@ -955,7 +953,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
955
953
|
name: 'simple-target'
|
|
956
954
|
};
|
|
957
955
|
|
|
958
|
-
const wrapper =
|
|
956
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
957
|
+
...requiredSetup(),
|
|
959
958
|
props: {
|
|
960
959
|
targets: [target1],
|
|
961
960
|
namespace: 'fleet-default',
|
|
@@ -979,7 +978,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
979
978
|
clusterName: 'fleet-5-france',
|
|
980
979
|
clusterSelector: { matchLabels: { foo: 'true' } }
|
|
981
980
|
};
|
|
982
|
-
const wrapper =
|
|
981
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
982
|
+
...requiredSetup(),
|
|
983
983
|
props: {
|
|
984
984
|
targets: [target1],
|
|
985
985
|
namespace: 'fleet-default',
|
|
@@ -1006,7 +1006,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1006
1006
|
}]
|
|
1007
1007
|
}
|
|
1008
1008
|
};
|
|
1009
|
-
const wrapper =
|
|
1009
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1010
|
+
...requiredSetup(),
|
|
1010
1011
|
props: {
|
|
1011
1012
|
targets: [target1],
|
|
1012
1013
|
namespace: 'fleet-default',
|
|
@@ -1031,7 +1032,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1031
1032
|
|
|
1032
1033
|
const target2 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
1033
1034
|
|
|
1034
|
-
const wrapper =
|
|
1035
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1036
|
+
...requiredSetup(),
|
|
1035
1037
|
props: {
|
|
1036
1038
|
targets: [target1, target2],
|
|
1037
1039
|
namespace: 'fleet-default',
|
|
@@ -1051,7 +1053,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1051
1053
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
1052
1054
|
const target2 = { clusterSelector: { matchLabels: { hci: 'true' } } };
|
|
1053
1055
|
|
|
1054
|
-
const wrapper =
|
|
1056
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1057
|
+
...requiredSetup(),
|
|
1055
1058
|
props: {
|
|
1056
1059
|
targets: [target1, target2],
|
|
1057
1060
|
namespace: 'fleet-default',
|
|
@@ -1070,7 +1073,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1070
1073
|
it('should emit advanced cases untouched', async() => {
|
|
1071
1074
|
const target1 = { clusterGroupSelector: {} };
|
|
1072
1075
|
|
|
1073
|
-
const wrapper =
|
|
1076
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1077
|
+
...requiredSetup(),
|
|
1074
1078
|
props: {
|
|
1075
1079
|
targets: [target1],
|
|
1076
1080
|
namespace: 'fleet-default',
|
|
@@ -1109,7 +1113,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1109
1113
|
name: 'tt1',
|
|
1110
1114
|
};
|
|
1111
1115
|
|
|
1112
|
-
const wrapper =
|
|
1116
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1117
|
+
...requiredSetup(),
|
|
1113
1118
|
props: {
|
|
1114
1119
|
targets: [target1],
|
|
1115
1120
|
namespace: 'fleet-default',
|
|
@@ -1142,7 +1147,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1142
1147
|
});
|
|
1143
1148
|
|
|
1144
1149
|
it('should emit harvester rule from empty targets source', async() => {
|
|
1145
|
-
const wrapper =
|
|
1150
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1151
|
+
...requiredSetup(),
|
|
1146
1152
|
props: {
|
|
1147
1153
|
targets: [], // targetMode === 'none'
|
|
1148
1154
|
namespace: 'fleet-default',
|
|
@@ -1161,7 +1167,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1161
1167
|
it('should emit untouched targets from source when operating in fleet-local workspace', async() => {
|
|
1162
1168
|
const target1 = { clusterSelector: { matchLabels: { foo: 'true' } } };
|
|
1163
1169
|
|
|
1164
|
-
const wrapper =
|
|
1170
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1171
|
+
...requiredSetup(),
|
|
1165
1172
|
props: {
|
|
1166
1173
|
targets: [target1],
|
|
1167
1174
|
namespace: 'fleet-local',
|
|
@@ -1192,7 +1199,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1192
1199
|
}
|
|
1193
1200
|
};
|
|
1194
1201
|
|
|
1195
|
-
const wrapper =
|
|
1202
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1203
|
+
...requiredSetup(),
|
|
1196
1204
|
props: {
|
|
1197
1205
|
targets: [target1],
|
|
1198
1206
|
namespace: 'fleet-default',
|
|
@@ -1217,7 +1225,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1217
1225
|
it('should emit targets excluding target names and adding harvester rule', async() => {
|
|
1218
1226
|
const target1 = { name: 'simple-target' };
|
|
1219
1227
|
|
|
1220
|
-
const wrapper =
|
|
1228
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1229
|
+
...requiredSetup(),
|
|
1221
1230
|
props: {
|
|
1222
1231
|
targets: [target1],
|
|
1223
1232
|
namespace: 'fleet-default',
|
|
@@ -1249,7 +1258,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1249
1258
|
name: 'simple-target'
|
|
1250
1259
|
};
|
|
1251
1260
|
|
|
1252
|
-
const wrapper =
|
|
1261
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1262
|
+
...requiredSetup(),
|
|
1253
1263
|
props: {
|
|
1254
1264
|
targets: [target1],
|
|
1255
1265
|
namespace: 'fleet-default',
|
|
@@ -1274,7 +1284,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1274
1284
|
describe('clusterGroup Functionality Tests', () => {
|
|
1275
1285
|
describe('clusterGroup Data Management', () => {
|
|
1276
1286
|
it('should initialize with empty selectedClusterGroups', () => {
|
|
1277
|
-
const wrapper =
|
|
1287
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1288
|
+
...requiredSetup(),
|
|
1278
1289
|
props: {
|
|
1279
1290
|
targets: [],
|
|
1280
1291
|
namespace: 'fleet-default',
|
|
@@ -1297,7 +1308,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1297
1308
|
}
|
|
1298
1309
|
];
|
|
1299
1310
|
|
|
1300
|
-
const wrapper =
|
|
1311
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1312
|
+
...requiredSetup(),
|
|
1301
1313
|
props: {
|
|
1302
1314
|
targets: [],
|
|
1303
1315
|
namespace: 'fleet-default',
|
|
@@ -1327,7 +1339,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1327
1339
|
}
|
|
1328
1340
|
];
|
|
1329
1341
|
|
|
1330
|
-
const wrapper =
|
|
1342
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1343
|
+
...requiredSetup(),
|
|
1331
1344
|
props: {
|
|
1332
1345
|
targets: [],
|
|
1333
1346
|
namespace: 'fleet-default',
|
|
@@ -1349,7 +1362,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1349
1362
|
|
|
1350
1363
|
describe('clusterGroup Selection Methods', () => {
|
|
1351
1364
|
it('should update selectedClusterGroups when selectClusterGroups is called', async() => {
|
|
1352
|
-
const wrapper =
|
|
1365
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1366
|
+
...requiredSetup(),
|
|
1353
1367
|
props: {
|
|
1354
1368
|
targets: [],
|
|
1355
1369
|
namespace: 'fleet-default',
|
|
@@ -1367,7 +1381,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1367
1381
|
});
|
|
1368
1382
|
|
|
1369
1383
|
it('should emit update:value when selectClusterGroups is called', async() => {
|
|
1370
|
-
const wrapper =
|
|
1384
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1385
|
+
...requiredSetup(),
|
|
1371
1386
|
props: {
|
|
1372
1387
|
targets: [],
|
|
1373
1388
|
namespace: 'fleet-default',
|
|
@@ -1382,7 +1397,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1382
1397
|
});
|
|
1383
1398
|
|
|
1384
1399
|
it('should handle empty array in selectClusterGroups', async() => {
|
|
1385
|
-
const wrapper =
|
|
1400
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1401
|
+
...requiredSetup(),
|
|
1386
1402
|
props: {
|
|
1387
1403
|
targets: [],
|
|
1388
1404
|
namespace: 'fleet-default',
|
|
@@ -1402,7 +1418,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1402
1418
|
});
|
|
1403
1419
|
|
|
1404
1420
|
it('should replace existing selectedClusterGroups on new selection', async() => {
|
|
1405
|
-
const wrapper =
|
|
1421
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1422
|
+
...requiredSetup(),
|
|
1406
1423
|
props: {
|
|
1407
1424
|
targets: [],
|
|
1408
1425
|
namespace: 'fleet-default',
|
|
@@ -1430,7 +1447,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1430
1447
|
{ clusterName: 'specific-cluster' }
|
|
1431
1448
|
];
|
|
1432
1449
|
|
|
1433
|
-
const wrapper =
|
|
1450
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1451
|
+
...requiredSetup(),
|
|
1434
1452
|
props: {
|
|
1435
1453
|
targets,
|
|
1436
1454
|
namespace: 'fleet-default',
|
|
@@ -1443,7 +1461,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1443
1461
|
});
|
|
1444
1462
|
|
|
1445
1463
|
it('should include clusterGroups in normalizeTargets output', () => {
|
|
1446
|
-
const wrapper =
|
|
1464
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1465
|
+
...requiredSetup(),
|
|
1447
1466
|
props: {
|
|
1448
1467
|
targets: [],
|
|
1449
1468
|
namespace: 'fleet-default',
|
|
@@ -1466,7 +1485,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1466
1485
|
});
|
|
1467
1486
|
|
|
1468
1487
|
it('should handle only clusterGroups in normalizeTargets', () => {
|
|
1469
|
-
const wrapper =
|
|
1488
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1489
|
+
...requiredSetup(),
|
|
1470
1490
|
props: {
|
|
1471
1491
|
targets: [],
|
|
1472
1492
|
namespace: 'fleet-default',
|
|
@@ -1483,7 +1503,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1483
1503
|
});
|
|
1484
1504
|
|
|
1485
1505
|
it('should return undefined when normalizeTargets has no inputs', () => {
|
|
1486
|
-
const wrapper =
|
|
1506
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1507
|
+
...requiredSetup(),
|
|
1487
1508
|
props: {
|
|
1488
1509
|
targets: [],
|
|
1489
1510
|
namespace: 'fleet-default',
|
|
@@ -1497,7 +1518,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1497
1518
|
});
|
|
1498
1519
|
|
|
1499
1520
|
it('should include clusterGroups in toTargets when targetMode is clusters', () => {
|
|
1500
|
-
const wrapper =
|
|
1521
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1522
|
+
...requiredSetup(),
|
|
1501
1523
|
props: {
|
|
1502
1524
|
targets: [],
|
|
1503
1525
|
namespace: 'fleet-default',
|
|
@@ -1528,7 +1550,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1528
1550
|
{ clusterGroup: 'test-group' }
|
|
1529
1551
|
];
|
|
1530
1552
|
|
|
1531
|
-
const wrapper =
|
|
1553
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1554
|
+
...requiredSetup(),
|
|
1532
1555
|
props: {
|
|
1533
1556
|
targets,
|
|
1534
1557
|
namespace: 'fleet-default',
|
|
@@ -1549,7 +1572,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1549
1572
|
{ clusterGroup: 'development-group' }
|
|
1550
1573
|
];
|
|
1551
1574
|
|
|
1552
|
-
const wrapper =
|
|
1575
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1576
|
+
...requiredSetup(),
|
|
1553
1577
|
props: {
|
|
1554
1578
|
targets,
|
|
1555
1579
|
namespace: 'fleet-default',
|
|
@@ -1564,7 +1588,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1564
1588
|
});
|
|
1565
1589
|
|
|
1566
1590
|
it('should reset selectedClusterGroups when reset method is called', () => {
|
|
1567
|
-
const wrapper =
|
|
1591
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1592
|
+
...requiredSetup(),
|
|
1568
1593
|
props: {
|
|
1569
1594
|
targets: [],
|
|
1570
1595
|
namespace: 'fleet-default',
|
|
@@ -1592,7 +1617,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1592
1617
|
|
|
1593
1618
|
describe('clusterGroup Event Handling and Updates', () => {
|
|
1594
1619
|
it('should emit correct targets when both clusters and clusterGroups are selected', async() => {
|
|
1595
|
-
const wrapper =
|
|
1620
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1621
|
+
...requiredSetup(),
|
|
1596
1622
|
props: {
|
|
1597
1623
|
targets: [],
|
|
1598
1624
|
namespace: 'fleet-default',
|
|
@@ -1619,7 +1645,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1619
1645
|
});
|
|
1620
1646
|
|
|
1621
1647
|
it('should handle clusterGroup selection in CREATE mode with proper event emission', async() => {
|
|
1622
|
-
const wrapper =
|
|
1648
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1649
|
+
...requiredSetup(),
|
|
1623
1650
|
props: {
|
|
1624
1651
|
targets: [],
|
|
1625
1652
|
namespace: 'fleet-default',
|
|
@@ -1646,7 +1673,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1646
1673
|
it('should update component state correctly when clusterGroups prop changes', async() => {
|
|
1647
1674
|
const initialTargets = [{ clusterGroup: 'initial-group' }];
|
|
1648
1675
|
|
|
1649
|
-
const wrapper =
|
|
1676
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1677
|
+
...requiredSetup(),
|
|
1650
1678
|
props: {
|
|
1651
1679
|
targets: initialTargets,
|
|
1652
1680
|
namespace: 'fleet-default',
|
|
@@ -1680,7 +1708,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1680
1708
|
{ clusterName: 'cluster-1' }
|
|
1681
1709
|
];
|
|
1682
1710
|
|
|
1683
|
-
const wrapper =
|
|
1711
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1712
|
+
...requiredSetup(),
|
|
1684
1713
|
props: {
|
|
1685
1714
|
targets: targets as any,
|
|
1686
1715
|
namespace: 'fleet-default',
|
|
@@ -1697,7 +1726,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1697
1726
|
{ clusterGroup: 'valid-group' }
|
|
1698
1727
|
];
|
|
1699
1728
|
|
|
1700
|
-
const wrapper =
|
|
1729
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1730
|
+
...requiredSetup(),
|
|
1701
1731
|
props: {
|
|
1702
1732
|
targets: targets as any,
|
|
1703
1733
|
namespace: 'fleet-default',
|
|
@@ -1709,7 +1739,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1709
1739
|
});
|
|
1710
1740
|
|
|
1711
1741
|
it('should handle empty allClusterGroups data', () => {
|
|
1712
|
-
const wrapper =
|
|
1742
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1743
|
+
...requiredSetup(),
|
|
1713
1744
|
props: {
|
|
1714
1745
|
targets: [],
|
|
1715
1746
|
namespace: 'fleet-default',
|
|
@@ -1735,7 +1766,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1735
1766
|
}
|
|
1736
1767
|
];
|
|
1737
1768
|
|
|
1738
|
-
const wrapper =
|
|
1769
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1770
|
+
...requiredSetup(),
|
|
1739
1771
|
props: {
|
|
1740
1772
|
targets: [],
|
|
1741
1773
|
namespace: 'fleet-default',
|
|
@@ -1756,7 +1788,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1756
1788
|
|
|
1757
1789
|
describe('clusterGroup Component Lifecycle', () => {
|
|
1758
1790
|
it('should preserve clusterGroup selections during component updates', async() => {
|
|
1759
|
-
const wrapper =
|
|
1791
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1792
|
+
...requiredSetup(),
|
|
1760
1793
|
props: {
|
|
1761
1794
|
targets: [],
|
|
1762
1795
|
namespace: 'fleet-default',
|
|
@@ -1777,7 +1810,8 @@ describe('component: FleetClusterTargets', () => {
|
|
|
1777
1810
|
});
|
|
1778
1811
|
|
|
1779
1812
|
it('should clear clusterGroup selections on namespace change in CREATE mode', async() => {
|
|
1780
|
-
const wrapper =
|
|
1813
|
+
const wrapper = mount(FleetClusterTargets, {
|
|
1814
|
+
...requiredSetup(),
|
|
1781
1815
|
props: {
|
|
1782
1816
|
targets: [],
|
|
1783
1817
|
namespace: 'fleet-default',
|