Skip to content

Commit

Permalink
test: remove unecessary render functions
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Dec 24, 2017
1 parent 56bfee6 commit c1915b9
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 42 deletions.
5 changes: 0 additions & 5 deletions test/bind.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ beforeEach(async () => {
collection = db.collection()
document = db.collection().doc()
vm = new Vue({
render (h) {
return h('ul', this.items && this.items.map(
item => h('li', [item])
))
},
// purposely set items as null
// but it's a good practice to set it to an empty array
data: () => ({
Expand Down
5 changes: 0 additions & 5 deletions test/collection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ let collection, vm
beforeEach(async () => {
collection = db.collection()
vm = new Vue({
render (h) {
return h('ul', this.items.map(
item => h('li', [item])
))
},
data: () => ({ items: null }),
firestore: {
items: collection
Expand Down
9 changes: 0 additions & 9 deletions test/document.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,10 @@ beforeEach(async () => {
collection = db.collection()
document = collection.doc()
vm = new Vue({
render (h) {
return h('ul', this.items.map(
item => h('li', [item])
))
},
// purposely set items as null
// but it's a good practice to set it to an empty array
data: () => ({
items: null,
item: null
}),
firestore: {
items: collection,
item: document
}
})
Expand Down
7 changes: 0 additions & 7 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ beforeEach(async () => {
collection = db.collection()
document = collection.doc()
vm = new Vue({
render (h) {
return h('ul', this.items.map(
item => h('li', [item])
))
},
// purposely set items as null
// but it's a good practice to set it to an empty array
data: () => ({
Expand All @@ -33,7 +28,6 @@ beforeEach(async () => {

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

test('setups _firestoreUnbinds with no firestore options', () => {
const vm = new Vue({
render: h => h('p', 'foo'),
data: () => ({ items: null })
})
expect(vm._firestoreUnbinds).toBeTruthy()
Expand Down
12 changes: 4 additions & 8 deletions test/merging.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ beforeEach(async () => {

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

test('supports function syntax', () => {
const vm = new Vue({
mixins: [mWithFn],
render: h => h('p', 'foo')
mixins: [mWithFn]
})
expect(vm.$firestoreRefs).toEqual({
a: db.collection(5),
Expand All @@ -57,8 +55,7 @@ test('supports function syntax', () => {

test('should merge two functions', () => {
const vm = new Vue({
mixins: [mWithObjA, mWithObjB, mWithFn],
render: h => h('p', 'foo')
mixins: [mWithObjA, mWithObjB, mWithFn]
})
expect(vm.$firestoreRefs).toEqual({
a: db.collection(5),
Expand All @@ -70,8 +67,7 @@ test('should merge two functions', () => {
test('ignores no return', () => {
const spy = Vue.config.errorHandler = jest.fn()
new Vue({
firestore: _ => {},
render: h => h('p', 'foo')
firestore: _ => {}
})
expect(spy).not.toHaveBeenCalled()
spy.mockRestore()
Expand Down
6 changes: 3 additions & 3 deletions test/refs-collections.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import {

Vue.use(Vuefire)

let vm, collection, a, b, first, second
let vm, collection, a, b
beforeEach(async () => {
a = db.collection().doc()
b = db.collection().doc()
await a.update({ isA: true })
await b.update({ isB: true })
collection = db.collection()
first = await collection.add({ ref: a })
second = await collection.add({ ref: b })
await collection.add({ ref: a })
await collection.add({ ref: b })

vm = new Vue({
data: () => ({
Expand Down
5 changes: 0 additions & 5 deletions test/unbind.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ beforeEach(async () => {
collection = db.collection()
document = collection.doc()
vm = new Vue({
render (h) {
return h('ul', this.items && this.items.map(
item => h('li', [item])
))
},
// purposely set items as null
// but it's a good practice to set it to an empty array
data: () => ({
Expand Down

0 comments on commit c1915b9

Please sign in to comment.