Skip to content

Commit c1915b9

Browse files
committed
test: remove unecessary render functions
1 parent 56bfee6 commit c1915b9

7 files changed

+7
-42
lines changed

test/bind.spec.js

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ beforeEach(async () => {
1212
collection = db.collection()
1313
document = db.collection().doc()
1414
vm = new Vue({
15-
render (h) {
16-
return h('ul', this.items && this.items.map(
17-
item => h('li', [item])
18-
))
19-
},
2015
// purposely set items as null
2116
// but it's a good practice to set it to an empty array
2217
data: () => ({

test/collection.spec.js

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ let collection, vm
1212
beforeEach(async () => {
1313
collection = db.collection()
1414
vm = new Vue({
15-
render (h) {
16-
return h('ul', this.items.map(
17-
item => h('li', [item])
18-
))
19-
},
2015
data: () => ({ items: null }),
2116
firestore: {
2217
items: collection

test/document.spec.js

-9
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,10 @@ beforeEach(async () => {
1313
collection = db.collection()
1414
document = collection.doc()
1515
vm = new Vue({
16-
render (h) {
17-
return h('ul', this.items.map(
18-
item => h('li', [item])
19-
))
20-
},
21-
// purposely set items as null
22-
// but it's a good practice to set it to an empty array
2316
data: () => ({
24-
items: null,
2517
item: null
2618
}),
2719
firestore: {
28-
items: collection,
2920
item: document
3021
}
3122
})

test/index.spec.js

-7
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ beforeEach(async () => {
1212
collection = db.collection()
1313
document = collection.doc()
1414
vm = new Vue({
15-
render (h) {
16-
return h('ul', this.items.map(
17-
item => h('li', [item])
18-
))
19-
},
2015
// purposely set items as null
2116
// but it's a good practice to set it to an empty array
2217
data: () => ({
@@ -33,7 +28,6 @@ beforeEach(async () => {
3328

3429
test('does nothing with no firestore', () => {
3530
const vm = new Vue({
36-
render: h => h('p', 'foo'),
3731
data: () => ({ items: null })
3832
})
3933
expect(vm.items).toEqual(null)
@@ -46,7 +40,6 @@ test('setups _firestoreUnbinds', () => {
4640

4741
test('setups _firestoreUnbinds with no firestore options', () => {
4842
const vm = new Vue({
49-
render: h => h('p', 'foo'),
5043
data: () => ({ items: null })
5144
})
5245
expect(vm._firestoreUnbinds).toBeTruthy()

test/merging.spec.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ beforeEach(async () => {
3434

3535
test('should merge properties', () => {
3636
const vm = new Vue({
37-
mixins: [mWithObjA, mWithObjB],
38-
render: h => h('p', 'foo')
37+
mixins: [mWithObjA, mWithObjB]
3938
})
4039
expect(vm.$firestoreRefs).toEqual({
4140
a: db.collection(3),
@@ -46,8 +45,7 @@ test('should merge properties', () => {
4645

4746
test('supports function syntax', () => {
4847
const vm = new Vue({
49-
mixins: [mWithFn],
50-
render: h => h('p', 'foo')
48+
mixins: [mWithFn]
5149
})
5250
expect(vm.$firestoreRefs).toEqual({
5351
a: db.collection(5),
@@ -57,8 +55,7 @@ test('supports function syntax', () => {
5755

5856
test('should merge two functions', () => {
5957
const vm = new Vue({
60-
mixins: [mWithObjA, mWithObjB, mWithFn],
61-
render: h => h('p', 'foo')
58+
mixins: [mWithObjA, mWithObjB, mWithFn]
6259
})
6360
expect(vm.$firestoreRefs).toEqual({
6461
a: db.collection(5),
@@ -70,8 +67,7 @@ test('should merge two functions', () => {
7067
test('ignores no return', () => {
7168
const spy = Vue.config.errorHandler = jest.fn()
7269
new Vue({
73-
firestore: _ => {},
74-
render: h => h('p', 'foo')
70+
firestore: _ => {}
7571
})
7672
expect(spy).not.toHaveBeenCalled()
7773
spy.mockRestore()

test/refs-collections.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import {
88

99
Vue.use(Vuefire)
1010

11-
let vm, collection, a, b, first, second
11+
let vm, collection, a, b
1212
beforeEach(async () => {
1313
a = db.collection().doc()
1414
b = db.collection().doc()
1515
await a.update({ isA: true })
1616
await b.update({ isB: true })
1717
collection = db.collection()
18-
first = await collection.add({ ref: a })
19-
second = await collection.add({ ref: b })
18+
await collection.add({ ref: a })
19+
await collection.add({ ref: b })
2020

2121
vm = new Vue({
2222
data: () => ({

test/unbind.spec.js

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ beforeEach(async () => {
1212
collection = db.collection()
1313
document = collection.doc()
1414
vm = new Vue({
15-
render (h) {
16-
return h('ul', this.items && this.items.map(
17-
item => h('li', [item])
18-
))
19-
},
2015
// purposely set items as null
2116
// but it's a good practice to set it to an empty array
2217
data: () => ({

0 commit comments

Comments
 (0)