|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`MereProps Order: MereProps Order 1`] = ` |
| 4 | +"import { createTextVNode, mergeProps, createVNode } from \\"vue\\"; |
| 5 | +createVNode(\\"button\\", mergeProps({ |
| 6 | + \\"loading\\": true |
| 7 | +}, x, { |
| 8 | + \\"type\\": \\"submit\\" |
| 9 | +}), [createTextVNode(\\"btn\\")], 16, [\\"loading\\"]);" |
| 10 | +`; |
| 11 | + |
| 12 | +exports[`Merge class/ style attributes into array: Merge class/ style attributes into array 1`] = ` |
| 13 | +"import { createVNode } from \\"vue\\"; |
| 14 | +createVNode(\\"div\\", { |
| 15 | + \\"class\\": [\\"a\\", b], |
| 16 | + \\"style\\": [\\"color: red\\", s] |
| 17 | +}, null, 6);" |
| 18 | +`; |
| 19 | + |
| 20 | +exports[`Without JSX should work: Without JSX should work 1`] = ` |
| 21 | +"import { createVNode } from 'vue'; |
| 22 | +createVNode('div', null, ['Without JSX should work']);" |
| 23 | +`; |
| 24 | + |
| 25 | +exports[`Without props: Without props 1`] = ` |
| 26 | +"import { createTextVNode, createVNode } from \\"vue\\"; |
| 27 | +createVNode(\\"a\\", null, [createTextVNode(\\"a\\")]);" |
| 28 | +`; |
| 29 | + |
| 30 | +exports[`custom directive: custom directive 1`] = ` |
| 31 | +"import { resolveComponent, resolveDirective, createVNode, withDirectives } from \\"vue\\"; |
| 32 | +withDirectives(createVNode(resolveComponent(\\"A\\"), null, null, 512), [[resolveDirective(\\"cus\\"), x]]);" |
| 33 | +`; |
| 34 | + |
| 35 | +exports[`dynamic type in input: dynamic type in input 1`] = ` |
| 36 | +"import { vModelDynamic, createVNode, withDirectives } from \\"vue\\"; |
| 37 | +withDirectives(createVNode(\\"input\\", { |
| 38 | + \\"type\\": type, |
| 39 | + \\"onUpdate:modelValue\\": $event => test = $event |
| 40 | +}, null, 8, [\\"type\\", \\"onUpdate:modelValue\\"]), [[vModelDynamic, test]]);" |
| 41 | +`; |
| 42 | + |
| 43 | +exports[`input[type="checkbox"]: input[type="checkbox"] 1`] = ` |
| 44 | +"import { vModelCheckbox, createVNode, withDirectives } from \\"vue\\"; |
| 45 | +withDirectives(createVNode(\\"input\\", { |
| 46 | + \\"type\\": \\"checkbox\\", |
| 47 | + \\"onUpdate:modelValue\\": $event => test = $event |
| 48 | +}, null, 8, [\\"onUpdate:modelValue\\"]), [[vModelCheckbox, test]]);" |
| 49 | +`; |
| 50 | + |
| 51 | +exports[`input[type="radio"]: input[type="radio"] 1`] = ` |
| 52 | +"import { Fragment, vModelRadio, createVNode, withDirectives } from \\"vue\\"; |
| 53 | +createVNode(Fragment, null, [withDirectives(createVNode(\\"input\\", { |
| 54 | + \\"type\\": \\"radio\\", |
| 55 | + \\"value\\": \\"1\\", |
| 56 | + \\"onUpdate:modelValue\\": $event => test = $event, |
| 57 | + \\"name\\": \\"test\\" |
| 58 | +}, null, 8, [\\"onUpdate:modelValue\\"]), [[vModelRadio, test]]), withDirectives(createVNode(\\"input\\", { |
| 59 | + \\"type\\": \\"radio\\", |
| 60 | + \\"value\\": \\"2\\", |
| 61 | + \\"onUpdate:modelValue\\": $event => test = $event, |
| 62 | + \\"name\\": \\"test\\" |
| 63 | +}, null, 8, [\\"onUpdate:modelValue\\"]), [[vModelRadio, test]])]);" |
| 64 | +`; |
| 65 | + |
| 66 | +exports[`input[type="text"] .lazy modifier: input[type="text"] .lazy modifier 1`] = ` |
| 67 | +"import { vModelText, createVNode, withDirectives } from \\"vue\\"; |
| 68 | +withDirectives(createVNode(\\"input\\", { |
| 69 | + \\"onUpdate:modelValue\\": $event => test = $event |
| 70 | +}, null, 8, [\\"onUpdate:modelValue\\"]), [[vModelText, test, void 0, { |
| 71 | + lazy: true |
| 72 | +}]]);" |
| 73 | +`; |
| 74 | + |
| 75 | +exports[`input[type="text"]: input[type="text"] 1`] = ` |
| 76 | +"import { vModelText, createVNode, withDirectives } from \\"vue\\"; |
| 77 | +withDirectives(createVNode(\\"input\\", { |
| 78 | + \\"onUpdate:modelValue\\": $event => test = $event |
| 79 | +}, null, 8, [\\"onUpdate:modelValue\\"]), [[vModelText, test]]);" |
| 80 | +`; |
| 81 | + |
| 82 | +exports[`reassign variable as component: reassign variable as component 1`] = ` |
| 83 | +"import { defineComponent, createVNode } from \\"vue\\"; |
| 84 | +let a = 1; |
| 85 | +const A = defineComponent({ |
| 86 | + setup(_, { |
| 87 | + slots |
| 88 | + }) { |
| 89 | + return () => createVNode(\\"span\\", null, [slots.default()]); |
| 90 | + } |
| 91 | +
|
| 92 | +}); |
| 93 | +const _a = 1; |
| 94 | +
|
| 95 | +const __a = function () { |
| 96 | + return a; |
| 97 | +}(); |
| 98 | +
|
| 99 | +a = createVNode(A, null, { |
| 100 | + default: () => [__a], |
| 101 | + _: 2 |
| 102 | +});" |
| 103 | +`; |
| 104 | + |
| 105 | +exports[`select: select 1`] = ` |
| 106 | +"import { createTextVNode, createVNode, vModelSelect, withDirectives } from \\"vue\\"; |
| 107 | +withDirectives(createVNode(\\"select\\", { |
| 108 | + \\"onUpdate:modelValue\\": $event => test = $event |
| 109 | +}, [createVNode(\\"option\\", { |
| 110 | + \\"value\\": \\"1\\" |
| 111 | +}, [createTextVNode(\\"a\\")]), createVNode(\\"option\\", { |
| 112 | + \\"value\\": 2 |
| 113 | +}, [createTextVNode(\\"b\\")]), createVNode(\\"option\\", { |
| 114 | + \\"value\\": 3 |
| 115 | +}, [createTextVNode(\\"c\\")])], 8, [\\"onUpdate:modelValue\\"]), [[vModelSelect, test]]);" |
| 116 | +`; |
| 117 | + |
| 118 | +exports[`should keep \`import * as Vue from "vue"\`: should keep \`import * as Vue from "vue"\` 1`] = ` |
| 119 | +"import { createTextVNode, createVNode } from \\"vue\\"; |
| 120 | +import * as Vue from 'vue'; |
| 121 | +createVNode(\\"div\\", null, [createTextVNode(\\"Vue\\")]);" |
| 122 | +`; |
| 123 | + |
| 124 | +exports[`single no need for a mergeProps call: single no need for a mergeProps call 1`] = ` |
| 125 | +"import { createTextVNode, createVNode } from \\"vue\\"; |
| 126 | +createVNode(\\"div\\", x, [createTextVNode(\\"single\\")], 16);" |
| 127 | +`; |
| 128 | + |
| 129 | +exports[`specifiers should be merged into a single importDeclaration: specifiers should be merged into a single importDeclaration 1`] = ` |
| 130 | +"import { createVNode, vShow } from \\"vue\\"; |
| 131 | +import { Fragment as _Fragment } from \\"vue\\"; |
| 132 | +createVNode(_Fragment, null, null);" |
| 133 | +`; |
| 134 | + |
| 135 | +exports[`textarea: textarea 1`] = ` |
| 136 | +"import { vModelText, createVNode, withDirectives } from \\"vue\\"; |
| 137 | +withDirectives(createVNode(\\"textarea\\", { |
| 138 | + \\"onUpdate:modelValue\\": $event => test = $event |
| 139 | +}, null, 8, [\\"onUpdate:modelValue\\"]), [[vModelText, test]]);" |
| 140 | +`; |
| 141 | + |
| 142 | +exports[`v-show: v-show 1`] = ` |
| 143 | +"import { createTextVNode, vShow, createVNode, withDirectives } from \\"vue\\"; |
| 144 | +withDirectives(createVNode(\\"div\\", null, [createTextVNode(\\"vShow\\")], 512), [[vShow, x]]);" |
| 145 | +`; |
| 146 | + |
| 147 | +exports[`vHtml: vHtml 1`] = ` |
| 148 | +"import { createVNode } from \\"vue\\"; |
| 149 | +createVNode(\\"h1\\", { |
| 150 | + \\"innerHTML\\": \\"<div>foo</div>\\" |
| 151 | +}, null, 8, [\\"innerHTML\\"]);" |
| 152 | +`; |
| 153 | + |
| 154 | +exports[`vText: vText 1`] = ` |
| 155 | +"import { createVNode } from \\"vue\\"; |
| 156 | +createVNode(\\"div\\", { |
| 157 | + \\"textContent\\": text |
| 158 | +}, null, 8, [\\"textContent\\"]);" |
| 159 | +`; |
0 commit comments