2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-19 15:40:33 +03:00

fix tests

This commit is contained in:
Declan de Wet
2016-11-10 17:47:54 +02:00
parent d218afa2e6
commit 814a0dd2c3
12 changed files with 25 additions and 12 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import getMetaInfo from '../shared/getMetaInfo'
import updateClientMetaInfo from './updateClientMetaInfo'
export default function _refresh (options) {
export default function _refresh (options = {}) {
/**
* When called, will update the current meta info with new meta info.
* Useful when updating meta info as the result of an asynchronous
+1 -1
View File
@@ -2,7 +2,7 @@ import updateTitle from './updaters/updateTitle'
import updateTagAttributes from './updaters/updateTagAttributes'
import updateTags from './updaters/updateTags'
export default function _updateClientMetaInfo (options) {
export default function _updateClientMetaInfo (options = {}) {
const { ssrAttribute } = options
/**
+3 -1
View File
@@ -1,4 +1,6 @@
export default function _updateTagAttributes ({ attribute }) {
export default function _updateTagAttributes (options = {}) {
const { attribute } = options
/**
* updates the document's html tag attributes
*
+3 -1
View File
@@ -1,7 +1,9 @@
// borrow the slice method
const toArray = Function.prototype.call.bind(Array.prototype.slice)
export default function _updateTags ({ attribute }) {
export default function _updateTags (options = {}) {
const { attribute } = options
/**
* Updates meta tags inside <head> on the client. Borrowed from `react-helmet`:
* https://github.com/nfl/react-helmet/blob/004d448f8de5f823d10f838b02317521180f34da/src/Helmet.js#L195-L245
+1 -1
View File
@@ -2,7 +2,7 @@ import titleGenerator from './generators/titleGenerator'
import attrsGenerator from './generators/attrsGenerator'
import tagGenerator from './generators/tagGenerator'
export default function _generateServerInjector (options) {
export default function _generateServerInjector (options = {}) {
/**
* Converts a meta info property to one that can be stringified on the server
*
+3 -1
View File
@@ -1,4 +1,6 @@
export default function _attrsGenerator ({ attribute }) {
export default function _attrsGenerator (options = {}) {
const { attribute } = options
/**
* Generates tag attributes for use on the server.
*
+3 -1
View File
@@ -1,4 +1,6 @@
export default function _tagGenerator ({ attribute }) {
export default function _tagGenerator (options = {}) {
const { attribute } = options
/**
* Generates meta, base, link, style, script, noscript tags for use on the server
*
+3 -1
View File
@@ -1,4 +1,6 @@
export default function _titleGenerator ({ attribute }) {
export default function _titleGenerator (options = {}) {
const { attribute } = options
/**
* Generates title output for the server
*
+1 -1
View File
@@ -1,7 +1,7 @@
import getMetaInfo from '../shared/getMetaInfo'
import generateServerInjector from './generateServerInjector'
export default function _inject (options) {
export default function _inject (options = {}) {
/**
* Converts the state of the meta info object such that each item
* can be compiled to a tag string on the server
+1 -1
View File
@@ -1,7 +1,7 @@
import inject from '../server/inject'
import refresh from '../client/refresh'
export default function _$meta (options) {
export default function _$meta (options = {}) {
/**
* Returns an injector for server-side rendering.
* @this {Object} - the Vue instance (a root component)
+2 -1
View File
@@ -1,7 +1,8 @@
import deepmerge from 'deepmerge'
import getComponentOption from './getComponentOption'
export default function _getMetaInfo ({ keyName, tagIDKeyName }) {
export default function _getMetaInfo (options = {}) {
const { keyName, tagIDKeyName } = options
/**
* Returns the correct meta info for the given component
* (child components will overwrite parent meta info)
+3 -1
View File
@@ -1,5 +1,7 @@
import Vue from 'vue'
import getMetaInfo from '../src/shared/getMetaInfo'
import _getMetaInfo from '../src/shared/getMetaInfo'
const getMetaInfo = _getMetaInfo()
describe('getMetaInfo', () => {
// const container = document.createElement('div')