@rancher/shell 0.2.2 → 0.2.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/package.json +1 -1
- package/rancher-components/BadgeState/BadgeState.spec.ts +12 -0
- package/rancher-components/BadgeState/BadgeState.vue +107 -0
- package/rancher-components/BadgeState/index.ts +1 -0
- package/rancher-components/Banner/Banner.test.ts +13 -0
- package/rancher-components/Banner/Banner.vue +163 -0
- package/rancher-components/Banner/index.ts +1 -0
- package/rancher-components/Card/Card.vue +150 -0
- package/rancher-components/Card/index.ts +1 -0
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +77 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +395 -0
- package/rancher-components/Form/Checkbox/index.ts +1 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +29 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +343 -0
- package/rancher-components/Form/LabeledInput/index.ts +1 -0
- package/rancher-components/Form/Radio/RadioButton.vue +270 -0
- package/rancher-components/Form/Radio/RadioGroup.vue +235 -0
- package/rancher-components/Form/Radio/index.ts +2 -0
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
- package/rancher-components/Form/TextArea/index.ts +1 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
- package/rancher-components/Form/ToggleSwitch/index.ts +1 -0
- package/rancher-components/Form/index.ts +5 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +137 -0
- package/rancher-components/LabeledTooltip/index.ts +1 -0
- package/scripts/publish-shell.sh +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { BadgeState } from './index';
|
|
3
|
+
|
|
4
|
+
describe('BadgeState.vue', () => {
|
|
5
|
+
it('renders props.msg when passed', () => {
|
|
6
|
+
const label = 'Hello, World!';
|
|
7
|
+
|
|
8
|
+
const wrapper = shallowMount(BadgeState, { propsData: { label } });
|
|
9
|
+
|
|
10
|
+
expect(wrapper.find('span').text()).toMatch(label);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Vue, { PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
interface Badge {
|
|
5
|
+
stateBackground: string;
|
|
6
|
+
stateDisplay: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Badge state component.
|
|
11
|
+
* <p>Represents a badge whose label and color is either taken from the value property or
|
|
12
|
+
* from the label and color properties. The state property takes precedence.</p>
|
|
13
|
+
*/
|
|
14
|
+
export default Vue.extend({
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* A value having the properties `stateBackground` and `stateDisplay`
|
|
18
|
+
*/
|
|
19
|
+
value: {
|
|
20
|
+
type: Object as PropType<Badge>,
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Badge color. `stateBackground` of the value property takes precedence if supplied
|
|
26
|
+
*/
|
|
27
|
+
color: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Optional icon to be shown before the label
|
|
34
|
+
*/
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: null
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Label to display in the badge. `stateDisplay` of the value property takes precedence if supplied
|
|
42
|
+
*/
|
|
43
|
+
label: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: null
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
computed: {
|
|
50
|
+
bg(): string | null {
|
|
51
|
+
return this.value?.stateBackground || this.color;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
msg(): string | null {
|
|
55
|
+
return this.value?.stateDisplay || this.label;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<span :class="{'badge-state': true, [bg]: true}">
|
|
63
|
+
<i v-if="icon" class="icon" :class="{[icon]: true, 'mr-5': !!msg}" />{{ msg }}
|
|
64
|
+
</span>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<style lang="scss" scoped>
|
|
68
|
+
.badge-state {
|
|
69
|
+
align-items: center;
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
padding: 2px 10px;
|
|
72
|
+
border: 1px solid transparent;
|
|
73
|
+
border-radius: 20px;
|
|
74
|
+
|
|
75
|
+
&.bg-info {
|
|
76
|
+
border-color: var(--primary);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&.bg-error {
|
|
80
|
+
border-color: var(--error);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.bg-warning {
|
|
84
|
+
border-color: var(--warning);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Successful states are de-emphasized by using [text-]color instead of background-color
|
|
88
|
+
&.bg-success {
|
|
89
|
+
color: var(--success);
|
|
90
|
+
background: transparent;
|
|
91
|
+
border-color: var(--success);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
95
|
+
<style lang="scss">
|
|
96
|
+
// TODO: #6005
|
|
97
|
+
// Investigate why this is here.. I don't think that styles for sortable table should belong here
|
|
98
|
+
.sortable-table TD .badge-state {
|
|
99
|
+
@include clip;
|
|
100
|
+
display: inline-block;
|
|
101
|
+
max-width: 100%;
|
|
102
|
+
position: relative;
|
|
103
|
+
max-width: 110px;
|
|
104
|
+
font-size: .85em;
|
|
105
|
+
vertical-align: middle;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BadgeState } from './BadgeState.vue';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { Banner } from './index';
|
|
3
|
+
|
|
4
|
+
describe('component: Banner', () => {
|
|
5
|
+
it('should display text based on label', () => {
|
|
6
|
+
const label = 'test';
|
|
7
|
+
const wrapper = mount(Banner, { propsData: { label } });
|
|
8
|
+
|
|
9
|
+
const element = wrapper.find('span').element;
|
|
10
|
+
|
|
11
|
+
expect(element.textContent).toBe(label);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Vue from 'vue';
|
|
3
|
+
import { nlToBr } from '@shell/utils/string';
|
|
4
|
+
import { stringify } from '@shell/utils/error';
|
|
5
|
+
|
|
6
|
+
export default Vue.extend({
|
|
7
|
+
props: {
|
|
8
|
+
/**
|
|
9
|
+
* A color class that represents the color of the banner.
|
|
10
|
+
* @values primary, secondary, success, warning, error, info
|
|
11
|
+
*/
|
|
12
|
+
color: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'secondary'
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* The label to display as the banner's default content.
|
|
18
|
+
*/
|
|
19
|
+
label: {
|
|
20
|
+
type: [String, Error, Object],
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* The i18n key for the label to display as the banner's default content.
|
|
25
|
+
*/
|
|
26
|
+
labelKey: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Toggles the banner's close button.
|
|
32
|
+
*/
|
|
33
|
+
closable: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Toggles the stacked class for the banner.
|
|
39
|
+
*/
|
|
40
|
+
stacked: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
/**
|
|
47
|
+
* Return message text as label.
|
|
48
|
+
*/
|
|
49
|
+
messageLabel(): string | void {
|
|
50
|
+
return !(typeof this.label === 'string') ? stringify(this.label) : undefined;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
methods: { nlToBr }
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
<template>
|
|
57
|
+
<div
|
|
58
|
+
class="banner"
|
|
59
|
+
:class="{
|
|
60
|
+
[color]: true,
|
|
61
|
+
closable,
|
|
62
|
+
stacked
|
|
63
|
+
}"
|
|
64
|
+
>
|
|
65
|
+
<slot>
|
|
66
|
+
<t v-if="labelKey" :k="labelKey" :raw="true" />
|
|
67
|
+
<span v-else-if="messageLabel">{{ messageLabel }}</span>
|
|
68
|
+
<span v-else v-html="nlToBr(label)" />
|
|
69
|
+
</slot>
|
|
70
|
+
<div v-if="closable" class="closer" @click="$emit('close')">
|
|
71
|
+
<i class="icon icon-2x icon-close closer-icon" />
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<style lang="scss" scoped>
|
|
77
|
+
$left-border-size: 4px;
|
|
78
|
+
|
|
79
|
+
.banner {
|
|
80
|
+
padding: 10px;
|
|
81
|
+
margin: 15px 0;
|
|
82
|
+
width: 100%;
|
|
83
|
+
transition: all 0.2s ease;
|
|
84
|
+
position: relative;
|
|
85
|
+
line-height: 20px;
|
|
86
|
+
|
|
87
|
+
&.stacked {
|
|
88
|
+
padding: 0 10px;
|
|
89
|
+
margin: 0;
|
|
90
|
+
transition: none;
|
|
91
|
+
&:first-child {
|
|
92
|
+
padding-top: 10px;
|
|
93
|
+
}
|
|
94
|
+
&:last-child {
|
|
95
|
+
padding-bottom: 10px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.closable {
|
|
100
|
+
padding-right: 40px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.closer {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
position: absolute;
|
|
109
|
+
top: 0;
|
|
110
|
+
right: 0;
|
|
111
|
+
bottom: 0;
|
|
112
|
+
width: 40px;
|
|
113
|
+
line-height: 42px;
|
|
114
|
+
text-align: center;
|
|
115
|
+
|
|
116
|
+
.closer-icon {
|
|
117
|
+
font-size: 22px;
|
|
118
|
+
opacity: 0.7;
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
opacity: 1;
|
|
122
|
+
color: var(--link);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.primary {
|
|
128
|
+
background: var(--primary);
|
|
129
|
+
border-left: solid $left-border-size var(--primary);
|
|
130
|
+
color: var(--body-text);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&.secondary {
|
|
134
|
+
background: var(--default-banner-bg);
|
|
135
|
+
border-left: solid $left-border-size var(--default);
|
|
136
|
+
color: var(--body-text);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.success {
|
|
140
|
+
background: var(--success-banner-bg);
|
|
141
|
+
border-left: solid $left-border-size var(--success);
|
|
142
|
+
color: var(--body-text);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&.info {
|
|
146
|
+
background: var(--info-banner-bg);
|
|
147
|
+
border-left: solid $left-border-size var(--info);
|
|
148
|
+
color: var(--body-text);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.warning {
|
|
152
|
+
background: var(--warning-banner-bg);
|
|
153
|
+
border-left: solid $left-border-size var(--warning);
|
|
154
|
+
color: var(--body-text);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.error {
|
|
158
|
+
background: var(--error-banner-bg);
|
|
159
|
+
border-left: solid $left-border-size var(--error);
|
|
160
|
+
color: var(--error);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Banner } from './Banner.vue';
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Vue from 'vue';
|
|
3
|
+
|
|
4
|
+
export default Vue.extend({
|
|
5
|
+
name: 'Card',
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* The card's title.
|
|
9
|
+
*/
|
|
10
|
+
title: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ''
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* The text content for the card's body.
|
|
16
|
+
*/
|
|
17
|
+
content: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* The function to invoke when the default action button is clicked.
|
|
23
|
+
*/
|
|
24
|
+
buttonAction: {
|
|
25
|
+
type: Function,
|
|
26
|
+
default: (): void => { }
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* The text for the default action button.
|
|
30
|
+
*/
|
|
31
|
+
buttonText: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'go'
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Toggles the card's highlight-border class.
|
|
37
|
+
*/
|
|
38
|
+
showHighlightBorder: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Toggles the card's Actions section.
|
|
44
|
+
*/
|
|
45
|
+
showActions: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
sticky: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<div class="card-container" :class="{'highlight-border': showHighlightBorder, 'card-sticky': sticky}">
|
|
59
|
+
<div class="card-wrap">
|
|
60
|
+
<div class="card-title">
|
|
61
|
+
<slot name="title">
|
|
62
|
+
{{ title }}
|
|
63
|
+
</slot>
|
|
64
|
+
</div>
|
|
65
|
+
<hr />
|
|
66
|
+
<div class="card-body">
|
|
67
|
+
<slot name="body">
|
|
68
|
+
{{ content }}
|
|
69
|
+
</slot>
|
|
70
|
+
</div>
|
|
71
|
+
<div v-if="showActions" class="card-actions">
|
|
72
|
+
<slot name="actions">
|
|
73
|
+
<button class="btn role-primary" @click="buttonAction">
|
|
74
|
+
{{ buttonText }}
|
|
75
|
+
</button>
|
|
76
|
+
</slot>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<style lang='scss'>
|
|
83
|
+
.card-container {
|
|
84
|
+
&.highlight-border {
|
|
85
|
+
border-left: 5px solid var(--primary);
|
|
86
|
+
}
|
|
87
|
+
border-radius: var(--border-radius);
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-basis: 40%;
|
|
90
|
+
margin: 10px;
|
|
91
|
+
min-height: 100px;
|
|
92
|
+
padding: 10px;
|
|
93
|
+
box-shadow: 0 0 20px var(--shadow);
|
|
94
|
+
&:not(.top) {
|
|
95
|
+
align-items: top;
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
justify-content: start;
|
|
98
|
+
}
|
|
99
|
+
.card-wrap {
|
|
100
|
+
width: 100%;
|
|
101
|
+
}
|
|
102
|
+
& .card-body {
|
|
103
|
+
color: var(--input-label);
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
}
|
|
108
|
+
& .card-actions {
|
|
109
|
+
align-self: end;
|
|
110
|
+
display: flex;
|
|
111
|
+
padding-top: 20px;
|
|
112
|
+
}
|
|
113
|
+
& .card-title {
|
|
114
|
+
align-items: center;
|
|
115
|
+
display: flex;
|
|
116
|
+
width: 100%;
|
|
117
|
+
h5 {
|
|
118
|
+
margin: 0;
|
|
119
|
+
}
|
|
120
|
+
.flex-right {
|
|
121
|
+
margin-left: auto;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Sticky mode will stick header and footer to top and bottom with content in the middle scrolling
|
|
126
|
+
&.card-sticky {
|
|
127
|
+
// display: flex;
|
|
128
|
+
// flex-direction: column;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
|
|
131
|
+
.card-wrap {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
|
|
135
|
+
.card-body {
|
|
136
|
+
justify-content: flex-start;
|
|
137
|
+
overflow: scroll;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
> * {
|
|
141
|
+
flex: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.card-body {
|
|
145
|
+
flex: 1;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Card } from './Card.vue';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { Checkbox } from './index';
|
|
3
|
+
|
|
4
|
+
describe('Checkbox.vue', () => {
|
|
5
|
+
it('is unchecked by default', () => {
|
|
6
|
+
const wrapper = shallowMount(Checkbox);
|
|
7
|
+
const cbInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
|
|
8
|
+
|
|
9
|
+
expect(cbInput.checked).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('renders a true value', () => {
|
|
13
|
+
const wrapper = shallowMount(Checkbox, { propsData: { value: true } });
|
|
14
|
+
const cbInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
|
|
15
|
+
|
|
16
|
+
expect(cbInput.checked).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('updates from false to true when props change', async () => {
|
|
20
|
+
const wrapper = shallowMount(Checkbox);
|
|
21
|
+
const cbInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
|
|
22
|
+
|
|
23
|
+
expect(cbInput.checked).toBe(false);
|
|
24
|
+
|
|
25
|
+
await wrapper.setProps({ value: true });
|
|
26
|
+
|
|
27
|
+
expect(cbInput.checked).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('emits an input event with a true value', async () => {
|
|
31
|
+
const wrapper = shallowMount(Checkbox);
|
|
32
|
+
const event = {
|
|
33
|
+
target: { tagName: 'input', href: null },
|
|
34
|
+
stopPropagation: () => { },
|
|
35
|
+
preventDefault: () => { }
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
(wrapper.vm as any).clicked(event);
|
|
39
|
+
await wrapper.vm.$nextTick();
|
|
40
|
+
|
|
41
|
+
expect(wrapper.emitted().input?.length).toBe(1);
|
|
42
|
+
expect(wrapper.emitted().input?.[0][0]).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('emits an input event with a custom valueWhenTrue', async () => {
|
|
46
|
+
const valueWhenTrue = 'BIG IF TRUE';
|
|
47
|
+
const event = {
|
|
48
|
+
target: { tagName: 'input', href: null },
|
|
49
|
+
stopPropagation: () => { },
|
|
50
|
+
preventDefault: () => { }
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const wrapper = shallowMount(Checkbox, { propsData: { value: false, valueWhenTrue } });
|
|
54
|
+
|
|
55
|
+
(wrapper.vm as any).clicked(event);
|
|
56
|
+
await wrapper.vm.$nextTick();
|
|
57
|
+
|
|
58
|
+
expect(wrapper.emitted().input?.length).toBe(1);
|
|
59
|
+
expect(wrapper.emitted().input?.[0][0]).toBe(valueWhenTrue);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('updates from valueWhenTrue to falsy', async () => {
|
|
63
|
+
const valueWhenTrue = 'REAL HUGE IF FALSE';
|
|
64
|
+
const event = {
|
|
65
|
+
target: { tagName: 'input', href: null },
|
|
66
|
+
stopPropagation: () => { },
|
|
67
|
+
preventDefault: () => { }
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const wrapper = shallowMount(Checkbox, { propsData: { value: valueWhenTrue, valueWhenTrue } });
|
|
71
|
+
|
|
72
|
+
(wrapper.vm as any).clicked(event);
|
|
73
|
+
await wrapper.vm.$nextTick();
|
|
74
|
+
|
|
75
|
+
expect(wrapper.emitted().input?.[0][0]).toBe(null);
|
|
76
|
+
})
|
|
77
|
+
});
|