@rancher/shell 3.0.2-rc.1 → 3.0.2-rc.2
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.
|
@@ -2,27 +2,27 @@ import { mount } from '@vue/test-utils';
|
|
|
2
2
|
import Settings from '@shell/edit/management.cattle.io.setting.vue';
|
|
3
3
|
import { SETTING } from '@shell/config/settings';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'i18n/exists': jest.fn(),
|
|
17
|
-
},
|
|
18
|
-
dispatch: jest.fn(),
|
|
5
|
+
const requiredSetup = () => ({
|
|
6
|
+
// Remove all these mocks after migration to Vue 2.7/3 due mixin logic
|
|
7
|
+
global: {
|
|
8
|
+
mocks: {
|
|
9
|
+
$store: {
|
|
10
|
+
getters: {
|
|
11
|
+
currentStore: () => 'current_store',
|
|
12
|
+
'current_store/schemaFor': jest.fn(),
|
|
13
|
+
'current_store/all': jest.fn(),
|
|
14
|
+
'i18n/t': jest.fn(),
|
|
15
|
+
'i18n/exists': jest.fn(),
|
|
19
16
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
17
|
+
dispatch: jest.fn(),
|
|
18
|
+
},
|
|
19
|
+
$route: { query: { AS: '' } },
|
|
20
|
+
$router: { applyQuery: jest.fn() },
|
|
23
21
|
}
|
|
24
|
-
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
25
24
|
|
|
25
|
+
describe('view: management.cattle.io.setting should', () => {
|
|
26
26
|
it('allowing to save if no rules in settings', () => {
|
|
27
27
|
const wrapper = mount(Settings, {
|
|
28
28
|
props: { value: { value: 'anything' } },
|
|
@@ -88,3 +88,22 @@ describe('view: management.cattle.io.setting should', () => {
|
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
|
+
|
|
92
|
+
describe('edit: management.cattle.io.setting should', () => {
|
|
93
|
+
it('display form errors', () => {
|
|
94
|
+
const wrapper = mount(Settings, {
|
|
95
|
+
props: {
|
|
96
|
+
value: { value: 'anything' },
|
|
97
|
+
mode: 'edit',
|
|
98
|
+
},
|
|
99
|
+
data: () => ({
|
|
100
|
+
setting: { },
|
|
101
|
+
errors: ['generic'] as any,
|
|
102
|
+
}),
|
|
103
|
+
...requiredSetup()
|
|
104
|
+
});
|
|
105
|
+
const errorBanner = wrapper.find('[data-testid="banner-content"]');
|
|
106
|
+
|
|
107
|
+
expect(errorBanner.element.textContent).toBe('generic');
|
|
108
|
+
});
|
|
109
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rancher/shell",
|
|
3
|
-
"version": "3.0.2-rc.
|
|
3
|
+
"version": "3.0.2-rc.2",
|
|
4
4
|
"description": "Rancher Dashboard Shell",
|
|
5
5
|
"repository": "https://github.com/rancherlabs/dashboard",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"diff2html": "3.4.24",
|
|
78
78
|
"dompurify": "2.5.4",
|
|
79
79
|
"element-matches": "^0.1.2",
|
|
80
|
+
"entities": "4.5.0",
|
|
80
81
|
"eslint-config-standard": "16.0.3",
|
|
81
82
|
"eslint-import-resolver-node": "0.3.4",
|
|
82
83
|
"eslint-module-utils": "2.6.1",
|