+34
-0
lines changedFilter options
+34
-0
lines changed Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ export default {
2
2
props: {
3
3
value: {},
4
4
placeholder: String,
5
+
name: String,
5
6
maxlength: [String, Number],
6
7
readonly: Boolean,
7
8
required: Boolean,
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
1
+
import Vue from 'vue'
2
+
import mountTemplate from 'test/utils/mountTemplate'
3
+
import MdFieldModule from 'components/MdField'
4
+
import MdField from '../MdField.vue'
5
+
6
+
Vue.use(MdFieldModule)
7
+
8
+
test('should render the input', async () => {
9
+
const template = `
10
+
<md-field>
11
+
<md-input></md-input>
12
+
</md-field>
13
+
`
14
+
const wrapper = await mountTemplate(MdField, template)
15
+
16
+
expect(wrapper.contains('.md-input')).toBe(true)
17
+
})
18
+
19
+
test('should preserve a value of the "name" attribute on change', async () => {
20
+
const template = `
21
+
<md-field>
22
+
<md-input name="details"></md-input>
23
+
</md-field>
24
+
`
25
+
const wrapper = await mountTemplate(MdField, template)
26
+
const input = wrapper.find('.md-input')[0]
27
+
28
+
input.trigger('change')
29
+
30
+
await wrapper.vm.$nextTick()
31
+
32
+
expect(input.getAttribute('name')).toBe('details')
33
+
})
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4