]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: layout more runtime-core tests
authorEvan You <yyx990803@gmail.com>
Thu, 22 Aug 2019 02:00:48 +0000 (22:00 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 22 Aug 2019 02:00:48 +0000 (22:00 -0400)
packages/runtime-core/__tests__/apiCreateComponent.spec.tsx [moved from packages/runtime-core/__tests__/createComponent.spec.tsx with 100% similarity]
packages/runtime-core/__tests__/apiInject.spec.ts [new file with mode: 0644]
packages/runtime-core/__tests__/apiLifecycle.spec.ts [new file with mode: 0644]
packages/runtime-core/__tests__/apiWatch.spec.ts [new file with mode: 0644]
packages/runtime-core/__tests__/vdomAttrsFallthrough.spec.ts [moved from packages/runtime-core/__tests__/attrsFallthrough.spec.ts with 98% similarity]
packages/runtime-core/__tests__/vdomChildren.spec.ts [new file with mode: 0644]
packages/runtime-core/__tests__/vdomComponent.spec.ts [new file with mode: 0644]
packages/runtime-core/__tests__/vdomElement.spec.ts [new file with mode: 0644]
packages/runtime-core/__tests__/vdomFragment.spec.ts [moved from packages/runtime-core/__tests__/fragment.spec.ts with 97% similarity]
packages/runtime-core/__tests__/vdomOptimizedMode.spec.ts [new file with mode: 0644]
packages/runtime-core/__tests__/vnode.spec.ts [new file with mode: 0644]

diff --git a/packages/runtime-core/__tests__/apiInject.spec.ts b/packages/runtime-core/__tests__/apiInject.spec.ts
new file mode 100644 (file)
index 0000000..b8c7bf6
--- /dev/null
@@ -0,0 +1 @@
+describe('api: provide/inject', () => {})
diff --git a/packages/runtime-core/__tests__/apiLifecycle.spec.ts b/packages/runtime-core/__tests__/apiLifecycle.spec.ts
new file mode 100644 (file)
index 0000000..bd1ccf5
--- /dev/null
@@ -0,0 +1 @@
+describe('api: lifecycle hooks', () => {})
diff --git a/packages/runtime-core/__tests__/apiWatch.spec.ts b/packages/runtime-core/__tests__/apiWatch.spec.ts
new file mode 100644 (file)
index 0000000..0c8316d
--- /dev/null
@@ -0,0 +1 @@
+describe('api: watch', () => {})
similarity index 98%
rename from packages/runtime-core/__tests__/attrsFallthrough.spec.ts
rename to packages/runtime-core/__tests__/vdomAttrsFallthrough.spec.ts
index 9cc625ac45bfda2163f029d1a6ead83c46857125..5e84406024f0c0b2fd665399faaa98b91e708892 100644 (file)
@@ -1,5 +1,5 @@
 // using DOM renderer because this case is mostly DOM-specific
-import { h, render, Component, nextTick, cloneVNode } from '@vue/runtime-dom'
+import { createVNode as h, render, nextTick, cloneVNode } from '@vue/runtime-dom'
 
 describe('attribute fallthrough', () => {
   it('everything should be in props when component has no declared props', async () => {
diff --git a/packages/runtime-core/__tests__/vdomChildren.spec.ts b/packages/runtime-core/__tests__/vdomChildren.spec.ts
new file mode 100644 (file)
index 0000000..84ec561
--- /dev/null
@@ -0,0 +1,35 @@
+describe('vdom: unkeyed children', () => {
+  test.todo('append')
+
+  test.todo('prepend')
+
+  test.todo('insert in middle')
+
+  test.todo('insert at beginning and end')
+
+  test.todo('insert to empty parent')
+
+  test.todo('shift with offset')
+
+  test.todo('remove from beginning')
+
+  test.todo('remove from end')
+
+  test.todo('remove from middle')
+
+  test.todo('moving single child forward')
+
+  test.todo('moving single child backwards')
+
+  test.todo('moving single child to end')
+
+  test.todo('swap first and last')
+
+  test.todo('move to left & replace')
+
+  test.todo('generic reorder')
+
+  test.todo('should not de-opt when both head and tail change')
+})
+
+describe('vdom: keyed children', () => {})
diff --git a/packages/runtime-core/__tests__/vdomComponent.spec.ts b/packages/runtime-core/__tests__/vdomComponent.spec.ts
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packages/runtime-core/__tests__/vdomElement.spec.ts b/packages/runtime-core/__tests__/vdomElement.spec.ts
new file mode 100644 (file)
index 0000000..6dc22fe
--- /dev/null
@@ -0,0 +1,7 @@
+describe('vdom: element', () => {
+  test.todo('with props')
+
+  test.todo('with direct text children')
+
+  test.todo('with text node children')
+})
similarity index 97%
rename from packages/runtime-core/__tests__/fragment.spec.ts
rename to packages/runtime-core/__tests__/vdomFragment.spec.ts
index 52157472f5c92dbebefbeea44d9b97086826d3c2..72f948f46ba1233aefbd6c72f39d23e0f02a8513 100644 (file)
@@ -1,23 +1,19 @@
 import {
-  h,
-  Component,
+  createVNode as h,
   render,
   nodeOps,
   NodeTypes,
   TestElement,
   Fragment,
-  observable,
+  reactive,
   serialize,
-  ChildrenFlags,
   nextTick,
   resetOps,
   dumpOps,
-  NodeOpTypes,
-  createFragment,
-  createTextVNode
+  NodeOpTypes
 } from '@vue/runtime-test'
 
-describe('Fragments', () => {
+describe('vdom: fragment', () => {
   it('should allow returning multiple component root nodes', async () => {
     class App extends Component {
       render() {
diff --git a/packages/runtime-core/__tests__/vdomOptimizedMode.spec.ts b/packages/runtime-core/__tests__/vdomOptimizedMode.spec.ts
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packages/runtime-core/__tests__/vnode.spec.ts b/packages/runtime-core/__tests__/vnode.spec.ts
new file mode 100644 (file)
index 0000000..e4d3927
--- /dev/null
@@ -0,0 +1,21 @@
+describe('vnode', () => {
+  test.todo('create with just tag')
+
+  test.todo('create with tag and props')
+
+  test.todo('create with tag, props and children')
+
+  test.todo('create with 0 as props')
+
+  test.todo('class normalization')
+
+  test.todo('style normalization')
+
+  test.todo('children normalization')
+
+  test.todo('normalizeVNode')
+
+  test.todo('node type inference')
+
+  test.todo('cloneVNode')
+})